/* Jalapeño Menu v1.0.0
 * Every rule is scoped to .jm-header (and .jm-band), so it won't affect the rest of your theme.
 * Change colours and fonts with the variables below.
 *
 * Without JavaScript or 3D support, the menu shows as a plain row of links.
 * When the 3D pepper is ready, the script adds .jm-ready and the overlay layout takes over.
 */
.jm-header {
  --jm-c0: #050305;  /* darkest shadow */
  --jm-c1: #2a2029;
  --jm-c2: #442135;
  --jm-c3: #8c3460;
  --jm-c4: #ad4a67;  /* brightest; also the label colour */
  --jm-label: var(--jm-c4);
  /* Uses your theme's fonts, so nothing loads from Google or anywhere else. */
  --jm-font-display: inherit;
  --jm-font-utility: inherit;
  /* Size: the plugin's Size setting picks one of the three presets further down. */
  --jm-height: 130px;   /* the pepper's area */
  --jm-row: 34px;       /* the label row under it */
  --jm-width: 520px;

  position: relative;
  max-width: var(--jm-width);
  margin: 0 auto;
  touch-action: manipulation;
}

/* The strip the plugin places at the top of every page. Transparent, so your page's
   own background or gradient shows through. */
.jm-band {
  background: transparent;
  padding-block: 8px 4px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* "Float" layout: the strip lies over the top of the page instead of pushing it down,
   so the page's own background (a gradient, an image) runs behind the pepper.
   It sits below the WordPress admin bar when you're logged in. */
.jm-band.jm-float {
  position: absolute;
  top: var(--wp-admin--admin-bar--height, 0px);
  left: 0;
  right: 0;
  z-index: 50;
  pointer-events: none; /* clicks on the empty sides go through to the page */
}
.jm-band.jm-float .jm-header { pointer-events: auto; }

/* ---------- plain-links fallback (before 3D is ready) ---------- */
.jm-header .jm-canvas,
.jm-header .jm-hint { display: none; }
.jm-header .jm-labels {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px;
  margin: 0; padding: 16px 0; list-style: none;
}
.jm-header .jm-labels a {
  display: inline-block; padding: 10px 6px;
  font-family: var(--jm-font-display); font-weight: 700; font-size: clamp(15px, 1.9vw, 22px);
  letter-spacing: .08em; color: var(--jm-label); text-decoration: none; white-space: nowrap;
  background-image: linear-gradient(var(--jm-label), var(--jm-label));
  background-size: 0% 2px; background-repeat: no-repeat; background-position: 50% 100%;
  transition: background-size .25s ease;
}
.jm-header .jm-labels a:hover { background-size: 70% 2px; }
.jm-header .jm-labels a:focus-visible { outline: 2px solid var(--jm-label); outline-offset: 4px; border-radius: 4px; background-size: 70% 2px; }

/* ---------- 3D layout ---------- */
.jm-header.jm-size-m { --jm-height: 160px; --jm-width: 700px; --jm-row: 40px; }
.jm-header.jm-size-l { --jm-height: 220px; --jm-width: 960px; --jm-row: 48px; }

.jm-header.jm-ready { height: calc(var(--jm-height) + var(--jm-row)); }
.jm-header.jm-ready .jm-canvas { display: block; position: absolute; left: 0; top: 0; width: 100%; height: var(--jm-height); outline: none; }
.jm-header.jm-ready .jm-canvas.jm-hot { cursor: pointer; }
.jm-header.jm-ready .jm-hint {
  display: block; position: absolute; left: 50%; top: var(--jm-height); transform: translateX(-50%);
  line-height: var(--jm-row);
  font-family: var(--jm-font-utility); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--jm-label); white-space: nowrap; pointer-events: none; transition: opacity .3s;
}
.jm-header.jm-ready.jm-open .jm-hint { opacity: 0; }
.jm-header.jm-ready .jm-labels { display: block; position: absolute; left: 0; right: 0; top: var(--jm-height); height: var(--jm-row); padding: 0; }
.jm-header.jm-ready .jm-labels a { padding: 6px 4px; font-size: 13px; letter-spacing: .06em; }
.jm-header.jm-ready.jm-size-m .jm-labels a { font-size: 15px; }
.jm-header.jm-ready.jm-size-l .jm-labels a { font-size: 19px; padding: 8px 6px; }
.jm-header.jm-ready .jm-labels li { position: absolute; top: 0; transform: translateX(-50%); }
.jm-header.jm-ready .jm-labels a {
  opacity: 0; transform: translateY(-10px);
  transition: opacity .35s ease .1s, transform .5s cubic-bezier(.2, .9, .25, 1.12) .05s, background-size .25s ease;
}
.jm-header.jm-ready.jm-open .jm-labels a { opacity: 1; transform: none; }
.jm-header.jm-ready .jm-labels a.jm-on { background-size: 70% 2px; }
.jm-header.jm-ready .jm-labels a:hover { background-size: 0% 2px; }
.jm-header.jm-ready .jm-labels a.jm-on:hover,
.jm-header.jm-ready .jm-labels a:focus-visible { background-size: 70% 2px; }

@media (max-width: 600px) {
  .jm-header.jm-ready { --jm-row: 58px; --jm-height: 110px; }
  .jm-header.jm-ready .jm-labels li:nth-child(even) { top: 26px; }
  .jm-header.jm-ready .jm-labels a, .jm-header.jm-ready.jm-size-m .jm-labels a, .jm-header.jm-ready.jm-size-l .jm-labels a { font-size: 13px; letter-spacing: .05em; padding: 5px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .jm-header .jm-labels a, .jm-header .jm-hint { transition: none; }
}
