/* ============================================================
   SMORT PILL NAV  (smort-pn)
   Gray-pill, white cursor, transparent-until-scroll header
   ============================================================ */

/* ---------- Header shell ---------- */
.smort-pn-header {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;

  width: min(calc(100vw - 2rem), 1280px);
  border-radius: 3rem;

  /* Transparent on page load — gains background on scroll */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;

  transition:
    background 0.25s ease,
    backdrop-filter 0.25s ease,
    box-shadow 0.25s ease,
    top 0.3s ease;
}

/* Frosted glass once user scrolls */
.smort-pn-header.is-scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.07),
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 16px 40px rgba(0, 0, 0, 0.10);
}

.smort-pn-header__inner {
  width: 100%;
  padding-inline: 1.5rem;
  display: flex;
  align-items: center;
  height: 64px;
  gap: 1.5rem;
}

/* ---------- Logo ---------- */
.smort-pn-header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.smort-pn-header__logo img {
  height: 28px;
  width: auto;
  display: block;
}

.smort-pn-header__wordmark {
  font-family: var(--heading-font);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: #111;
  letter-spacing: -0.03em;
}

/* ---------- Nav wrapper (centers pill) ---------- */
.smort-pn-header__nav-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ============================================================
   THE PILL
   ============================================================ */
.smort-pn {
  position: relative;
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 4px;
  border: none;
  border-radius: 9999px;
  background: #f5f5f0;           /* soft gray container */
  width: fit-content;
  user-select: none;
  overflow: visible;             /* allow dropdowns to escape the pill */
}

/* ---------- Nav items ---------- */
.smort-pn__item {
  position: relative;
  z-index: 10;
  list-style: none;
  cursor: pointer;
}

.smort-pn__submenu {
  position: absolute;
  top: calc(100% + 0.1rem);
  left: 0;
  min-width: 13rem;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  border-radius: 0.9rem;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
  display: grid;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 20;
}

/* Bridge hover gap between parent pill item and dropdown */
.smort-pn__item.has-submenu::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.7rem;
}

.smort-pn__item:hover > .smort-pn__submenu,
.smort-pn__item.is-submenu-open > .smort-pn__submenu,
.smort-pn__item:focus-within > .smort-pn__submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.smort-pn__sublink {
  display: block;
  padding: 0.62rem 0.75rem;
  border-radius: 0.65rem;
  font-family: var(--body-font);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.15;
  color: #111;
  text-decoration: none;
  white-space: nowrap;
}

.smort-pn__sublink:hover,
.smort-pn__subitem.current-menu-item > .smort-pn__sublink,
.smort-pn__subitem.current_page_item > .smort-pn__sublink {
  background: #f5f5f0;
}

.smort-pn__link--parent::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.42rem;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(17, 17, 17, 0.58);
  vertical-align: middle;
}

.smort-pn__link {
  display: block;
  padding: 8px 16px;
  font-family: var(--body-font);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: none;          /* natural case — no all-caps */
  letter-spacing: 0;
  text-decoration: none;
  line-height: 1;
  border-radius: 9999px;
  white-space: nowrap;
  color: #111;                   /* always black — no mix-blend tricks */
}

@media (min-width: 768px) {
  .smort-pn__link {
    padding: 10px 20px;
    font-size: 0.9375rem;
  }
}

/* ---------- Sliding cursor (white pill) ---------- */
.smort-pn__cursor {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);     /* always fills pill interior — never overflows */
  background: #fff;
  border-radius: 9999px;
  z-index: 0;
  list-style: none;
  pointer-events: none;
  width: 60px;                  /* overridden by JS on load */

  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.10),
    0 1px 2px rgba(0, 0, 0, 0.06);

  transition:
    left    0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    width   0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 0.15s ease;

  opacity: 0;
}

/* Opacity is managed entirely by JS — cursor starts hidden, JS fades it in */

/* ---------- CTA ---------- */
.smort-pn-header__cta {
  flex-shrink: 0;
  margin-left: auto;
}

/* ---------- Hamburger ---------- */
.smort-pn-header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.smort-pn-header__burger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: #111;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.smort-pn-header__burger[aria-expanded="true"] .smort-pn-header__burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.smort-pn-header__burger[aria-expanded="true"] .smort-pn-header__burger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.smort-pn-header__burger[aria-expanded="true"] .smort-pn-header__burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Mobile drawer ---------- */
.smort-pn-header__mobile {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 0 1rem 1rem;
  background: rgba(255, 255, 255, 0.97);
}

.smort-pn-header__mobile.is-open {
  max-height: 480px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.smort-pn-mobile__list {
  list-style: none;
  margin: 0;
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.smort-pn-mobile__list .sub-menu {
  list-style: none;
  margin: 0.15rem 0 0.4rem;
  padding: 0 0 0 0.9rem;
  border-left: 2px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.smort-pn-mobile__list .sub-menu a {
  font-size: 0.94rem;
  font-weight: 450;
  padding-block: 0.62rem;
}

.smort-pn-mobile__list li a {
  display: block;
  padding: 0.75rem 1rem;
  font-family: var(--body-font);
  font-size: 1rem;
  font-weight: 500;
  color: #111;
  text-decoration: none;
  border-radius: 0.625rem;
  transition: background 0.15s ease;
}

.smort-pn-mobile__list li a:hover,
.smort-pn-mobile__list li.current-menu-item > a,
.smort-pn-mobile__list li.current_page_item > a {
  background: #f1f1f1;
}

/* ---------- Responsive breakpoints ---------- */
@media (max-width: 1024px) {
  .smort-pn-header {
    top: 0.5rem;
    width: min(calc(100vw - 1.5rem), 100%);
    border-radius: 0.75rem;
  }

  .smort-pn-header__nav-wrap {
    display: none;
  }

  .smort-pn-header__cta {
    display: none;
  }

  .smort-pn-header__burger {
    display: flex;
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .smort-pn-header {
    top: 0.375rem;
    width: calc(100% - 1rem);
    border-radius: 0.625rem;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .smort-pn__cursor {
    transition: opacity 0.1s ease;
  }

  .smort-pn-header__mobile {
    transition: none;
  }
}

/* ============================================================
   SMORT 4.0 — mörk, flytande glas-pill med tunn kant (alltid mörk,
   smort-tone--dark, så den läses lika bra över ljusa och mörka
   sektioner). Lagt sist för att ersätta ljusa värden ovan.
   ============================================================ */
.smort-pn-header {
  top: 1rem;
  background: rgba(14, 14, 14, 0.78);
  border: 1px solid var(--smort-line-strong);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    backdrop-filter 0.35s ease,
    top 0.3s ease,
    transform 0.45s var(--smort-ease);
}

.smort-pn-header.is-scrolled {
  background: rgba(14, 14, 14, 0.72);
  border-color: var(--smort-line-strong);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: none;
}

.smort-pn-header__inner {
  height: 60px;
  padding-inline: 0.5rem 0.5rem;
  padding-left: 1.25rem;
}

.smort-pn-header__logo img {
  height: 24px;
  filter: brightness(0) invert(1);
}

.smort-pn-header__wordmark {
  color: var(--smort-fg);
}

.smort-pn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--smort-line);
}

.smort-pn__link {
  color: rgba(245, 245, 240, 0.72);
  transition: color 0.25s ease;
}

.smort-pn__item:hover > .smort-pn__link,
.smort-pn__item.is-active > .smort-pn__link,
.smort-pn__item.current-menu-item > .smort-pn__link {
  color: var(--smort-ink);
}

.smort-pn__cursor {
  background: var(--primary);
}

.smort-pn__link--parent::after {
  border-top-color: currentColor;
}

.smort-pn__submenu {
  background: rgba(17, 17, 17, 0.96);
  border: 1px solid var(--smort-line-strong);
  box-shadow: none;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.smort-pn__sublink {
  color: rgba(245, 245, 240, 0.8);
}

.smort-pn__sublink:hover,
.smort-pn__subitem.current-menu-item > .smort-pn__sublink,
.smort-pn__subitem.current_page_item > .smort-pn__sublink {
  background: rgba(255, 255, 255, 0.06);
  color: var(--smort-fg);
}

.smort-pn-header__burger-line {
  background: var(--smort-fg);
}

.smort-pn-header__mobile {
  background: rgba(12, 12, 12, 0.97);
}

.smort-pn-header__mobile.is-open {
  border-top: 1px solid var(--smort-line);
}

.smort-pn-mobile__list li a {
  color: var(--smort-fg);
  font-family: var(--heading-font);
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
}

.smort-pn-mobile__list .sub-menu {
  border-left-color: var(--smort-line-strong);
}

.smort-pn-mobile__list li a:hover,
.smort-pn-mobile__list li.current-menu-item > a,
.smort-pn-mobile__list li.current_page_item > a {
  background: rgba(255, 255, 255, 0.05);
  color: var(--primary);
}

/* Göms vid scroll nedåt, visas vid scroll uppåt (sätts i header.js) */
.smort-pn-header.is-hidden {
  transform: translate(-50%, calc(-100% - 1.5rem));
}

@media (max-width: 1024px) {
  .smort-pn-header {
    top: 0.5rem;
    border-radius: 1.25rem;
  }

  .smort-pn-header.is-open,
  .smort-pn-header:has(.smort-pn-header__mobile.is-open) {
    background: rgba(12, 12, 12, 0.97);
    border-color: var(--smort-line-strong);
  }
}

@media (prefers-reduced-motion: reduce) {
  .smort-pn-header {
    transition: none;
  }

  .smort-pn-header.is-hidden {
    transform: translateX(-50%);
  }
}

/* ===== Runda 4: varumärkesrena färger (endast #0A0A0A, #F5F5F0, #E2FAB3, #FFFFFF) ===== */
.smort-pn-header { background: rgba(10, 10, 10, 0.86); }

/* Runda 6c: menyval under lime-markören – alltid svart text (#0A0A0A) */
.smort-pn__item > .smort-pn__link { position: relative; z-index: 1; }
.smort-pn .smort-pn__item.is-cursor > .smort-pn__link { color: #0A0A0A; }
.smort-pn:has(.is-cursor) .smort-pn__item.is-active:not(.is-cursor) > .smort-pn__link,
.smort-pn:has(.is-cursor) .smort-pn__item.current-menu-item:not(.is-cursor) > .smort-pn__link,
.smort-pn:has(.is-cursor) .smort-pn__item:hover:not(.is-cursor) > .smort-pn__link { color: rgba(245, 245, 240, 0.72); }

/* ============================================================
   Runda 10 – ljus header som tidigare (Johan: "ljusare manér").
   Vit frostad bar med hårfin kant, svart text, svart aktiv
   markör med ljus text, lime CTA. Alltid ljus så den läses över
   både hero och mörka sektioner (egen bakgrund + skugga).
   ============================================================ */
.smort-pn-header,
.smort-pn-header.is-scrolled {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(10, 10, 10, 0.08);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.04), 0 12px 32px -16px rgba(10, 10, 10, 0.18);
}
.smort-pn-header__logo img { filter: none; }
.smort-pn-header__wordmark { color: #0A0A0A; }
.smort-pn {
  background: #F5F5F0;
  border: 1px solid rgba(10, 10, 10, 0.06);
}
.smort-pn__link,
.smort-pn:has(.is-cursor) .smort-pn__item.is-active:not(.is-cursor) > .smort-pn__link,
.smort-pn:has(.is-cursor) .smort-pn__item.current-menu-item:not(.is-cursor) > .smort-pn__link,
.smort-pn:has(.is-cursor) .smort-pn__item:hover:not(.is-cursor) > .smort-pn__link { color: rgba(10, 10, 10, 0.72); }
.smort-pn__item:hover > .smort-pn__link { color: #0A0A0A; }
.smort-pn__cursor { background: #0A0A0A; }
.smort-pn .smort-pn__item.is-cursor > .smort-pn__link,
.smort-pn__item.is-active > .smort-pn__link,
.smort-pn__item.current-menu-item > .smort-pn__link { color: #F5F5F0; }
.smort-pn:has(.is-cursor) .smort-pn__item.is-active:not(.is-cursor) > .smort-pn__link { color: rgba(10, 10, 10, 0.72); }
.smort-pn__submenu {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(10, 10, 10, 0.08);
  box-shadow: 0 16px 40px -16px rgba(10, 10, 10, 0.2);
}
.smort-pn__sublink { color: rgba(10, 10, 10, 0.78); }
.smort-pn__sublink:hover,
.smort-pn__subitem.current-menu-item > .smort-pn__sublink,
.smort-pn__subitem.current_page_item > .smort-pn__sublink { background: #F5F5F0; color: #0A0A0A; }
.smort-pn-header__burger-line { background: #0A0A0A; }
.smort-pn-header__mobile { background: #FFFFFF; }
.smort-pn-header__mobile.is-open { border-top: 1px solid rgba(10, 10, 10, 0.08); }
.smort-pn-mobile__list li a { color: #0A0A0A; }
.smort-pn-mobile__list .sub-menu { border-left-color: rgba(10, 10, 10, 0.12); }
.smort-pn-mobile__list li a:hover,
.smort-pn-mobile__list li.current-menu-item > a,
.smort-pn-mobile__list li.current_page_item > a { background: #E2FAB3; color: #0A0A0A; }
@media (max-width: 1024px) {
  .smort-pn-header.is-open,
  .smort-pn-header:has(.smort-pn-header__mobile.is-open) {
    background: #FFFFFF;
    border-color: rgba(10, 10, 10, 0.08);
  }
}
