/* ============================================
   REGION LISTER · header stripe (line 2 under VillageHeader)
   Per the Claude Design handoff. Pure CSS reveal animation —
   no JS required for the animation itself. Mobile drawer
   uses lister-stripe.js.
   ============================================ */

/* ── Wrap with perspective; reveal-fold rotates inside it ────
   Positioned absolutely just under the Freysta header (.site-header
   is position: absolute, top: 0, height ~77 px). Both scroll away
   together with the page. */
.lister-stripe-wrap {
  position: absolute;
  top: 77px;
  left: 0;
  right: 0;
  perspective: 520px;
  perspective-origin: 50% 0%;
  z-index: 999; /* just below Freysta header (1000) and dropdowns */
}

@media (max-width: 768px) {
  .lister-stripe-wrap { top: 60px; }
}

/* Aurora hairline — lives OUTSIDE the rotating fold so it stays
   visible even when the fold is showing its back face. */
.aurora-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 7;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(125, 211, 192, 0.85) 18%,
    rgba(125, 211, 192, 1) 50%,
    rgba(125, 211, 192, 0.85) 82%,
    transparent 100%
  );
  box-shadow:
    0 0 10px rgba(125, 211, 192, 0.55),
    0 0 22px rgba(125, 211, 192, 0.25);
  transform-origin: center;
  transform: scaleX(0);
  animation: lister-line-draw 1.25s cubic-bezier(0.55, 0.05, 0.3, 1) 0.6s both;
  pointer-events: none;
}

/* The fold — 3D unfold from a closed flap to flat. */
.reveal-fold {
  position: relative;
  transform-origin: top center;
  transform: rotateX(-95deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  animation: lister-unfold 2.1s cubic-bezier(0.5, 0, 0.18, 1) 1.85s both;
}
.reveal-fold .lister-stripe {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.reveal-fold::after {
  /* Ambient shade overlay — reads as light landing on the unfolding
     flap. Starts heavy, lifts as the flap finishes laying flat. */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.25) 60%,
    rgba(0, 0, 0, 0) 100%
  );
  animation: lister-flap-light 2.1s cubic-bezier(0.5, 0, 0.18, 1) 1.85s both;
  z-index: 4;
}

@keyframes lister-line-draw {
  from { transform: scaleX(0); opacity: 0; }
  20%  { opacity: 1; }
  to   { transform: scaleX(1); opacity: 1; }
}
@keyframes lister-unfold {
  from { transform: rotateX(-95deg); }
  to   { transform: rotateX(0deg); }
}
@keyframes lister-flap-light {
  from { opacity: 1; }
  60%  { opacity: 0.55; }
  to   { opacity: 0; }
}

/* ── Stripe container ────────────────────────────────────────── */
.lister-stripe {
  position: relative;
  min-height: 60px;
  padding: 0; /* padding lives on .lister-stripe__inner to match Freysta */
  background: rgba(10, 22, 40, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.lister-stripe__inner {
  /* Mirror .site-header--village .header-inner exactly: full width,
     padding-left/right at --space-2xl. The Freysta logo and our coin
     then sit at the same x-coordinate. */
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding-left: var(--space-2xl, 3rem);
  padding-right: var(--space-2xl, 3rem);
  min-height: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

/* ── Brand (left) — small Region Lister coin + wordmark text ── */
.lister-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fbf9f6;
  font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 200ms ease;
}
.lister-brand:hover,
.lister-brand:focus-visible {
  opacity: 0.85;
  outline: none;
}

.lister-brand__coin {
  /* Matches the Freysta logo size (44 px) so the two header rows
     visually balance — same disc diameter, same horizontal position. */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1f3548;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(125, 211, 192, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.lister-brand__coin img {
  /* Wordmark is a square SVG with the letters REGION / LISTER stacked.
     Inset so the letterforms have a touch of margin from the coin edge. */
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
}

.lister-brand__text {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.lister-brand__sep {
  opacity: 0.6;
  letter-spacing: 0.18em;
  font-weight: 400;
}

/* ── Nav (right) ─────────────────────────────────────────────── */
.lister-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.lister-nav__link {
  position: relative;
  display: inline-block;
  padding: 14px 0;
  color: rgba(251, 249, 246, 0.72);
  font-family: var(--font-body, 'Glacial Indifference', sans-serif);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 200ms ease;
}
/* Gold-dot separator between sibling links */
.lister-nav__link + .lister-nav__link::before {
  content: '';
  position: absolute;
  left: -13px;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(196, 145, 138, 0.45);
}

.lister-nav__link:hover { color: #fbf9f6; }
.lister-nav__link:hover::after {
  content: '';
  position: absolute;
  inset: auto 0 8px 0;
  height: 1px;
  background: rgba(125, 211, 192, 0.4);
}

.lister-nav__link.is-on { color: #fbf9f6; }
.lister-nav__link.is-on::after {
  content: '';
  position: absolute;
  inset: auto 0 8px 0;
  height: 1px;
  background: linear-gradient(90deg, var(--color-aurora, #7dd3c0), rgba(125, 211, 192, 0.2));
}

/* ── Dropdown (Kommuner, Boområder) ─────────────────────────── */
.lister-nav__group {
  position: relative;
  display: inline-flex;
  align-items: center;
}
/* Invisible hover-bridge below the toggle that covers the 8 px gap
   to the dropdown menu. Lives on the group (not on the menu) so it
   works even when the menu has overflow:auto (.lister-nav__menu--tall),
   which would otherwise clip a pseudo-element on the menu itself. */
.lister-nav__group::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 14px;
  pointer-events: none;
}
.lister-nav__group:hover::after,
.lister-nav__group.is-open::after {
  pointer-events: auto;
}

.lister-nav__link--toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  /* button strips inherit; bring it back so it matches the anchor links */
  font: inherit;
  font-family: var(--font-body, 'Glacial Indifference', sans-serif);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(251, 249, 246, 0.72);
}

.lister-nav__caret {
  width: 10px;
  height: 10px;
  transition: transform 200ms ease;
  opacity: 0.7;
}
.lister-nav__group:hover .lister-nav__caret,
.lister-nav__group.is-open .lister-nav__caret,
.lister-nav__link--toggle[aria-expanded="true"] .lister-nav__caret {
  transform: rotate(180deg);
}

.lister-nav__menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 180px;
  margin: 8px 0 0;
  padding: 8px 0;
  list-style: none;
  background: rgba(10, 22, 40, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(125, 211, 192, 0.18);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 200ms ease,
    transform 200ms ease,
    visibility 0s linear 200ms;
  z-index: 10;
}
/* Invisible hover-bridge over the 8 px gap between the toggle and
   the menu — keeps the dropdown open while the cursor crosses from
   the button to the items. */
.lister-nav__menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -12px; /* covers the 8 px gap plus a little overshoot */
  height: 12px;
}
.lister-nav__group:hover .lister-nav__menu,
.lister-nav__group:focus-within .lister-nav__menu,
.lister-nav__group.is-open .lister-nav__menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition:
    opacity 200ms ease,
    transform 200ms ease,
    visibility 0s linear 0s;
}

.lister-nav__menu-link {
  display: block;
  padding: 10px 18px;
  color: rgba(251, 249, 246, 0.82);
  font-family: var(--font-body, 'Glacial Indifference', sans-serif);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
}
.lister-nav__menu-link:hover,
.lister-nav__menu-link:focus-visible {
  background: rgba(125, 211, 192, 0.12);
  color: var(--color-cream, #f1ebe3);
  outline: none;
}

/* Tall variant for the boområder menu (15 items would otherwise
   spill off the bottom of the viewport on smaller screens) */
.lister-nav__menu--tall {
  max-height: min(70vh, 520px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 211, 192, 0.35) transparent;
}
.lister-nav__menu--tall::-webkit-scrollbar { width: 6px; }
.lister-nav__menu--tall::-webkit-scrollbar-track { background: transparent; }
.lister-nav__menu--tall::-webkit-scrollbar-thumb {
  background: rgba(125, 211, 192, 0.35);
  border-radius: 3px;
}

/* ── Mobile (≤768px) ────────────────────────────────────────── */
.lister-mobile-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 12px;
  color: rgba(251, 249, 246, 0.85);
  font-family: var(--font-body, 'Glacial Indifference', sans-serif);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}
.lister-mobile-toggle:hover,
.lister-mobile-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.32);
  outline: none;
}
.lister-mobile-toggle__caret {
  width: 12px;
  height: 12px;
  transition: transform 200ms ease;
}
.lister-mobile-toggle[aria-expanded="true"] .lister-mobile-toggle__caret {
  transform: rotate(180deg);
}

.lister-mobile-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(10, 22, 40, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 6;
  padding: 8px 0;
}
.lister-mobile-drawer:not([hidden]) {
  display: block;
}
.lister-mobile-drawer nav {
  display: flex;
  flex-direction: column;
}
.lister-mobile-drawer__link {
  padding: 14px var(--space-lg, 2rem);
  color: rgba(251, 249, 246, 0.78);
  font-family: var(--font-body, 'Glacial Indifference', sans-serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.lister-mobile-drawer__link:last-child { border-bottom: none; }
.lister-mobile-drawer__link.is-on {
  color: var(--color-cream, #f1ebe3);
  background: rgba(125, 211, 192, 0.08);
  border-left: 2px solid var(--color-aurora, #7dd3c0);
}

@media (max-width: 768px) {
  .lister-stripe {
    padding: 0 var(--space-lg, 2rem);
  }
  .lister-brand {
    font-size: 11px;
    letter-spacing: 0.3em;
    gap: 10px;
  }
  .lister-brand__coin { width: 36px; height: 36px; }
  .lister-brand__coin img { width: 24px; height: 24px; }
  .lister-nav { display: none; }
  .lister-mobile-toggle { display: inline-flex; }
}

/* ── Reduced motion — go directly to final state ─────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal-fold,
  .reveal-fold::after,
  .aurora-line {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .reveal-fold::after { display: none; }
}
