/* The site menu, the same kind as Buon Cibo's (2026-10-02, Jim: "samma sorts meny på telefon, dator och knapp
   till sidan som Buon Cibo har"). One markup (jn_menu() in build.py) on the start page and every inner page:
   a fixed header — wordmark left, "Boka föreläsning" and the round button with the turning ring text right —
   that opens a dark panel of photo tiles on a computer and a full-screen dark sheet of rows on a phone. */
:root { --jn-accent: var(--accent, var(--star, #9fd7b5)); --jn-ink: var(--accent-ink, var(--star-ink, #000)); --jn-dark: #121311; --jn-ease: cubic-bezier(0.25, 1, 0.5, 1); --jn-swing: cubic-bezier(0.76, 0, 0.24, 1); }

/* ── the header ─────────────────────────────────────────────────────────────── */
.jnh { position: fixed; inset: 0 0 auto 0; z-index: 101; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.6rem 0 2.5rem; pointer-events: none; }
.jnh > * { pointer-events: auto; }
.jnh-logo, .jnh-book { color: #fff; transition: color 300ms; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; white-space: nowrap; text-decoration: none; }
.jnh-right { display: flex; align-items: center; gap: 1.5rem; }
.jnh-book { display: inline-flex; align-items: center; gap: 0.6rem; letter-spacing: 0.2em; }
.jnh-book svg { width: 0.9rem; height: 0.9rem; transition: transform 350ms var(--jn-ease); }
.jnh-book:hover svg { transform: translate(2px, 2px); }
.jnh-book .short { display: none; }
.jnh-sound { transition: color 300ms; }
/* over beige the header goes dark (jn-menu.js decides per part) */
.jnh-logo.jn-ink, .jnh-book.jn-ink, .jnh-sound.jn-ink { color: var(--jn-dark); }
.jnh-btn.jn-ink .jnh-ring text { fill: var(--jn-dark); }

.jnh-btn { position: relative; display: grid; place-items: center; width: 5.6rem; height: 5.6rem; margin: -0.6rem -0.4rem 0 0; padding: 0; border: 0; background: none; color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.jnh-ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: jn-turn 28s linear infinite; }
.jnh-ring text { fill: #fff; transition: fill 300ms; font-size: 8.4px; font-weight: 500; letter-spacing: 2.6px; text-transform: uppercase; }
.jnh-core { position: relative; display: grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 50%; background: var(--jn-dark); border: 1px solid rgb(255 255 255 / 0.14); box-shadow: 0 10px 28px -14px rgb(0 0 0 / 0.6); transition: transform 400ms var(--jn-ease), border-color 300ms; }
.jnh-btn:hover .jnh-core { transform: scale(1.05); border-color: color-mix(in oklab, var(--jn-accent) 60%, transparent); }
.jnh-lines { position: relative; display: block; width: 1.35rem; height: 0.8rem; }
.jnh-lines i { position: absolute; left: 0; right: 0; height: 1.5px; border-radius: 2px; background: #fff; transition: transform 450ms var(--jn-ease), opacity 250ms, top 450ms var(--jn-ease); }
.jnh-lines i:nth-child(1) { top: 0; } .jnh-lines i:nth-child(2) { top: 50%; translate: 0 -50%; } .jnh-lines i:nth-child(3) { top: 100%; translate: 0 -100%; }
.jn-open .jnh-lines i:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.jn-open .jnh-lines i:nth-child(2) { opacity: 0; }
.jn-open .jnh-lines i:nth-child(3) { top: 50%; translate: 0 0; transform: translateY(-50%) rotate(-45deg); }
.jn-open .jnh-ring { opacity: 0; transition: opacity 250ms; }
.jn-open .jnh-book, .jn-open .jnh-sound { opacity: 0; pointer-events: none; transition: opacity 250ms; }
@keyframes jn-turn { to { transform: rotate(360deg); } }

/* ── the menu ──────────────────────────────────────────────────────────────── */
.jnm { position: fixed; inset: 0; z-index: 100; color: #fff; font-family: inherit; }
.jnm[inert] { pointer-events: none; }
.jnm a { color: inherit; text-decoration: none; }
.jnm-k { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: rgb(255 255 255 / 0.55); }
.jnm-k .star { color: var(--jn-accent); margin-right: 0.45rem; }
.jnm-cta { display: inline-flex; align-items: center; justify-content: space-between; gap: 0.7rem; padding: 0.85rem 1.2rem; border-radius: 3px; background: var(--jn-accent); color: var(--jn-ink) !important; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; transition: filter 300ms; }
.jnm-cta:hover { filter: brightness(1.08); }
.jnm-cta svg { width: 1rem; height: 1rem; }
.jnm-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.85rem 0.9rem; border: 1px solid rgb(255 255 255 / 0.2); border-radius: 3px; font-size: 0.625rem; letter-spacing: 0.16em; text-transform: uppercase; transition: border-color 250ms, background-color 250ms; }
.jnm-btn:hover { border-color: rgb(255 255 255 / 0.5); background: rgb(255 255 255 / 0.04); }
.jnm-item { display: grid; }
.jnm-img { position: relative; display: block; overflow: hidden; background: #000; }
.jnm-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--jn-ease), filter 600ms; }
.jnm-name { text-transform: uppercase; letter-spacing: -0.01em; line-height: 1; }
.jnm-name .cur { color: var(--jn-accent); font-size: 0.8em; margin-right: 0.45rem; }
.jnm-item[aria-current] .jnm-name { color: var(--jn-accent); }
.jnm-detail { display: block; font-size: 0.625rem; letter-spacing: 0.18em; text-transform: uppercase; color: rgb(255 255 255 / 0.5); }
.jnm-arrow { width: 1rem; height: 1rem; color: var(--jn-accent); opacity: 0.6; }
.jnm-foot { display: grid; gap: 1rem; }
.jnm-foot a { display: block; line-height: 1.8; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; transition: color 200ms; }
.jnm-foot a:hover { color: var(--jn-accent); }
.jnm-rise { opacity: 0; translate: 0 1rem; transition: opacity 600ms var(--jn-ease), translate 700ms var(--jn-ease); }
.jnm.open .jnm-rise { opacity: 1; translate: 0 0; }

/* computer: a dark panel over the page, photo tiles in a grid */
@media (min-width: 1024px) {
  .jnm { display: grid; place-items: center; padding: 6.5rem 2rem 2rem; background: rgb(0 0 0 / 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity 450ms var(--jn-ease); }
  .jnm.open { opacity: 1; }
  .jnm-panel { width: min(64rem, 100%); max-height: calc(100svh - 8.5rem); overflow: auto; padding: 1.75rem 1.75rem 1.5rem; background: var(--jn-dark); border: 1px solid color-mix(in oklab, var(--jn-accent) 45%, transparent); box-shadow: 0 0 0 1px rgb(0 0 0 / 0.4), 0 0 40px -12px color-mix(in oklab, var(--jn-accent) 40%, transparent), 0 40px 80px -30px rgb(0 0 0 / 0.7); transform: scale(0.97) translateY(0.75rem); transition: transform 600ms var(--jn-ease); }
  .jnm.open .jnm-panel { transform: none; }
  .jnm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
  .jnm-quick { display: none; }
  .jnm-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem 1rem; }
  /* seven pages since Militären (2026-10-03): the last tile spans two columns so both rows end flush */
  .jnm-list > li:nth-child(7):last-child { grid-column: span 2; }
  .jnm-list > li:nth-child(7):last-child .jnm-item { height: 100%; grid-template-rows: 1fr auto; }
  .jnm-list > li:nth-child(7):last-child .jnm-img { aspect-ratio: auto; }
  .jnm-item { grid-template-areas: "pic" "det"; gap: 0.6rem; }
  .jnm-img { grid-area: pic; aspect-ratio: 16 / 10; }
  .jnm-img img { filter: grayscale(0.25) brightness(0.72); }
  .jnm-item:hover .jnm-img img { transform: scale(1.05); filter: none; }
  .jnm-txt { display: contents; }
  .jnm-name { grid-area: pic; align-self: end; justify-self: start; position: relative; z-index: 1; margin: 0 0 0.75rem 0.85rem; font-size: 1.05rem; text-shadow: 0 1px 12px rgb(0 0 0 / 0.5); }
  .jnm-detail { grid-area: det; }
  .jnm-arrow { display: none; }
  .jnm-foot { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid rgb(255 255 255 / 0.1); }
}

/* phone and tablet: a full-screen dark sheet that grows out of the round button, one row per page */
@media (max-width: 1023.98px) {
  .jnh { padding: 0.75rem 0.6rem 0 1.25rem; }
  .jnh-btn { width: 4.6rem; height: 4.6rem; margin: -0.3rem 0 0 0; }
  .jnh-core { width: 2.9rem; height: 2.9rem; }
  .jnh-ring text { font-size: 9px; }
  .jnh-right { gap: 0.6rem; }
  .jnh-book .long { display: none; } .jnh-book .short { display: inline; }
  .jnm { overflow-y: auto; overscroll-behavior: contain; background: #1a1c19; clip-path: circle(0% at calc(100% - 2.9rem) 2.6rem); transition: clip-path 850ms var(--jn-swing); }
  .jnm.open { clip-path: circle(150% at calc(100% - 2.9rem) 2.6rem); }
  .jnm::before { content: ""; position: fixed; inset: 0.5rem; border: 1px solid color-mix(in oklab, var(--jn-accent) 35%, transparent); pointer-events: none; }
  .jnm-panel { min-height: 100svh; padding: 5.6rem 1.25rem 2.5rem; }
  .jnm-head { display: none; }
  .jnm-quick { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
  .jnm-quick .jnm-cta { flex: 1; padding: 0.95rem 1rem; font-size: 0.8125rem; }
  .jnm-list { display: block; }
  .jnm-item { grid-template-columns: 3rem 1fr auto; align-items: center; gap: 0.85rem; height: clamp(3.2rem, calc((100svh - 22rem) / 7), 4rem); border-bottom: 1px solid rgb(255 255 255 / 0.1); }
  .jnm-img { width: 3rem; height: 2.25rem; }
  .jnm-txt { display: flex; flex-direction: column; justify-content: center; gap: 0.35rem; min-width: 0; }
  .jnm-name { font-size: 1.3rem; }
  .jnm-detail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .jnm-foot { grid-template-columns: 1fr 1fr; margin-top: 1.75rem; }
  .jnm-foot > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 380px) { .jnh-logo { font-size: 0.6875rem; letter-spacing: 0.16em; } }
/* short phones (iPhone SE, 667 px): seven rows still fit without scrolling */
@media (max-width: 1023.98px) and (max-height: 700px) {
  .jnm-panel { padding-top: 4.9rem; padding-bottom: 1.5rem; }
  .jnm-item { height: 2.85rem; }
  .jnm-img { width: 2.6rem; height: 1.95rem; }
  .jnm-name { font-size: 1.15rem; }
  .jnm-foot { margin-top: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .jnh-ring { animation: none; }
  .jnm, .jnm-panel, .jnm-rise, .jnh-lines i { transition-duration: 1ms !important; transition-delay: 0ms !important; }
}

/* ── the top bar dropdowns, computer only (2026-11-08, Jim: "meny som i klippet") ─────────────────────────
   One dark glass panel under the bar. Moving between triggers slides and resizes the panel to the next pane
   while the panes cross-fade sideways — the details.so "Navigation Dropdown". Calm timing, nothing snappy. */
.jnd { display: none; }
@media (min-width: 1024px) {
  .jnd { --jnd-t: 520ms; display: block; position: absolute; left: 50%; top: 2.05rem; translate: -50% 0; width: max-content; }
  /* the bar is its own dark glass capsule: tracked capitals like the rest of the header, a small accent number
     before each word, a soft pill that glides to the item under the pointer, and the word rolls up on hover */
  .jnd-bar { position: relative; display: flex; align-items: center; gap: 0.1rem; margin: 0; padding: 0.3rem; list-style: none; border-radius: 999px; background: rgb(18 19 17 / 0.86); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); border: 1px solid rgb(255 255 255 / 0.12); box-shadow: 0 12px 30px -16px rgb(0 0 0 / 0.55), inset 0 1px 0 rgb(255 255 255 / 0.08); }
  .jnd-bar > li { position: relative; z-index: 1; }
  .jnd-trigger, .jnd-link { position: relative; display: inline-flex; align-items: center; gap: 0.5rem; height: 2.35rem; padding: 0 1rem; border: 0; border-radius: 999px; background: none; color: rgb(255 255 255 / 0.78); font: inherit; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; white-space: nowrap; cursor: pointer; transition: color 300ms; }
  .jnd-trigger:hover, .jnd-link:hover, .jnd-trigger[aria-expanded="true"], .jnd-link[aria-current] { color: #fff; }
  .jnd-n { font-family: "Space Mono", ui-monospace, monospace; font-size: 0.5625rem; letter-spacing: 0.04em; color: rgb(255 255 255 / 0.4); translate: 0 -0.3em; transition: color 300ms; }
  .jnd-trigger:hover .jnd-n, .jnd-link:hover .jnd-n, .jnd-trigger[aria-expanded="true"] .jnd-n { color: rgb(255 255 255 / 0.75); }
  .jnd-t { position: relative; display: inline-block; overflow: hidden; line-height: 1.25; }
  .jnd-t .a, .jnd-t .b { display: block; transition: translate 520ms var(--jn-ease); }
  .jnd-t .b { position: absolute; inset: 100% 0 auto 0; }
  .jnd-trigger:hover .jnd-t .a, .jnd-link:hover .jnd-t .a, .jnd-trigger:hover .jnd-t .b, .jnd-link:hover .jnd-t .b { translate: 0 -100%; }
  .jnd-plus { width: 0.7rem; height: 0.7rem; margin-left: -0.1rem; opacity: 0.6; transition: transform 450ms var(--jn-ease), opacity 300ms; }
  .jnd-trigger[aria-expanded="true"] .jnd-plus { transform: rotate(45deg); opacity: 1; }
  .jnd-link[aria-current]::after { content: ""; position: absolute; left: 50%; bottom: 0.3rem; width: 3px; height: 3px; border-radius: 50%; background: #fff; translate: -50% 0; }
  .jnd-glow { position: absolute !important; z-index: 0 !important; top: 0.3rem; left: 0; width: 0; height: 2.35rem; border-radius: 999px; background: rgb(255 255 255 / 0.14); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1); opacity: 0; pointer-events: none; transition: left 480ms var(--jn-ease), width 480ms var(--jn-ease), opacity 300ms; }
  .jnd-glow.on { opacity: 1; }
  .jnd-glow.jump { transition: opacity 300ms; }
  .jnd-trigger:focus-visible, .jnd-link:focus-visible, .jnd-panel a:focus-visible { outline: 1.5px solid var(--jn-accent); outline-offset: 2px; }
  .jn-open .jnd { opacity: 0; pointer-events: none; transition: opacity 250ms; }

  .jnd-panel { position: absolute; top: calc(100% + 0.6rem); left: 0; width: 20rem; height: 10rem; overflow: hidden; border-radius: 14px; background: rgb(20 21 19 / 0.84); -webkit-backdrop-filter: blur(22px) saturate(1.3); backdrop-filter: blur(22px) saturate(1.3); border: 1px solid rgb(255 255 255 / 0.1); box-shadow: 0 30px 60px -24px rgb(0 0 0 / 0.65), inset 0 1px 0 rgb(255 255 255 / 0.06); opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top center; transition: opacity 320ms var(--jn-ease), transform 420ms var(--jn-ease); }
  .jnd-panel.ready { transition: opacity 320ms var(--jn-ease), transform 420ms var(--jn-ease), left var(--jnd-t) var(--jn-ease), width var(--jnd-t) var(--jn-ease), height var(--jnd-t) var(--jn-ease); }
  .jnd-panel.open { opacity: 1; transform: none; }
  /* invisible bridge so the pointer can cross the gap from the bar into the panel */
  .jnd.has-open::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 0.8rem; }

  .jnd-pane { position: absolute; top: 0; left: 0; padding: 0.5rem; opacity: 0; pointer-events: none; visibility: hidden; transition: opacity 360ms var(--jn-ease), translate 480ms var(--jn-ease), visibility 0s linear 480ms; }
  .jnd-pane.on { opacity: 1; translate: 0 0 !important; pointer-events: auto; visibility: visible; transition: opacity 420ms var(--jn-ease) 80ms, translate 520ms var(--jn-ease), visibility 0s; }
  .jnd-pane.from-right { translate: 1.5rem 0; }
  .jnd-pane.from-left { translate: -1.5rem 0; }

  .jnd-list { margin: 0; padding: 0; list-style: none; }
  .jnd-row { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.7rem 0.85rem; border-radius: 9px; color: #fff; text-decoration: none; transition: background-color 250ms; }
  .jnd-row:hover, .jnd-row:focus-visible, .jnd-row.on { background: rgb(255 255 255 / 0.07); }
  .jnd-row-name { font-size: 0.875rem; font-weight: 500; letter-spacing: 0.01em; }
  .jnd-row[aria-current] .jnd-row-name { color: var(--jn-accent); }
  .jnd-row-detail { font-size: 0.75rem; line-height: 1.35; color: rgb(255 255 255 / 0.55); }

  .jnd-explore { display: grid; grid-template-columns: 15rem 17rem; gap: 0.5rem; }
  .jnd-pic { position: relative; overflow: hidden; border-radius: 9px; background: #000; }
  .jnd-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity 600ms var(--jn-ease), transform 1100ms var(--jn-ease); }
  .jnd-pic img.on { opacity: 1; transform: none; }

  .jnd-book { display: grid; grid-template-columns: 13.5rem 13.5rem; gap: 0.5rem; }
  .jnd-card { position: relative; display: block; height: 15.5rem; overflow: hidden; border-radius: 9px; background: #000; color: #fff; text-decoration: none; }
  .jnd-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.85); transition: transform 1100ms var(--jn-ease), filter 500ms; }
  .jnd-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / 0.78), rgb(0 0 0 / 0) 58%); }
  .jnd-card:hover img { transform: scale(1.04); filter: none; }
  .jnd-card-txt { position: absolute; z-index: 1; inset: auto 0 0 0; display: flex; flex-direction: column; gap: 0.25rem; padding: 0.9rem; }
  .jnd-card-name { font-size: 0.9375rem; font-weight: 500; }
  .jnd-card-detail { font-size: 0.75rem; line-height: 1.35; color: rgb(255 255 255 / 0.72); }

  .jnd-follow { width: 13rem; }
  .jnd-follow .jnd-list { display: grid; }
}
/* computer: the bar replaces the round menu button (Jim 2026-11-08: "ta bort den svarta cirkeln"); the phone keeps it */
@media (min-width: 1024px) { .jnh-btn { display: none; } .jnh { padding-right: 2.5rem; padding-top: 2.05rem; } .jnd { top: 1.1rem; } }
@media (prefers-reduced-motion: reduce) {
  .jnd-glow, .jnd-t .a, .jnd-t .b, .jnd-panel, .jnd-panel.ready, .jnd-pane, .jnd-pane.on, .jnd-pic img, .jnd-card img { transition-duration: 1ms !important; transition-delay: 0ms !important; }
}
/* small computers: no room beside the bar for "Boka föreläsning" — it lives in the bar's Boka dropdown */
@media (min-width: 1024px) and (max-width: 1159.98px) { .jnh-book { display: none; } }
