/* 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; }
}
