/* ==========================================================================
   Site menu: grouped panels with hobby emblems + "Jump to" palette.
   Markup from scripts/update_nav.py, behaviour in assets/js/nav.js.
   Builds on main.css header styles (.header__nav, .header__nav-link, --cta).
   ========================================================================== */

.nav2__list { gap: var(--space-md, 1rem); }
.nav2__item { position: relative; }

/* Group triggers look like the old links, with a chevron */
.nav2__trigger {
    display: inline-flex; align-items: center; gap: 0.3em; padding: 0.35rem 0.1rem;
    font: inherit; font-size: var(--font-size-sm); font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary); background: none; border: 0; cursor: pointer; white-space: nowrap;
    transition: color var(--transition-fast, 0.15s);
}
.nav2__trigger:hover, .nav2__trigger:focus-visible, .nav2__item.is-open .nav2__trigger { color: var(--color-text); }
.nav2__trigger:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }
.nav2__chev { width: 10px; height: 10px; transition: transform 0.25s ease; opacity: 0.6; }
.nav2__item.is-open .nav2__chev { transform: rotate(180deg); }
.nav2__item.is-current > .nav2__trigger { color: var(--color-text); }
.nav2__item.is-current > .nav2__trigger::after {
    content: ""; position: absolute; left: 0.1rem; right: 1rem; bottom: -0.15rem; height: 2px; border-radius: 2px; background: #D6A85A;
}
.nav2__trigger .nav-new { margin-left: 0.35em; }

/* Panel (desktop) */
.nav2__panel {
    position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%);
    width: min(640px, 92vw); display: grid; grid-template-columns: 190px 1fr; gap: 0;
    background: var(--color-surface, #fff); color: var(--color-text);
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08)); border-radius: 18px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.06);
    overflow: hidden; z-index: 60; animation: nav2-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav2__panel[hidden] { display: none; }
.nav2__panel::before { content: ""; position: absolute; top: -16px; left: 0; right: 0; height: 16px; } /* hover bridge */
@keyframes nav2-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.nav2__item--edge-r .nav2__panel { left: auto; right: -40px; transform: none; animation-name: nav2-in-r; }
@keyframes nav2-in-r { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Left column: the hobby emblem and a one-line intro */
.nav2__intro {
    position: relative; padding: 1.3rem 1.2rem; color: #ECE7DE;
    background: radial-gradient(120% 90% at 0% 0%, rgba(214, 168, 90, 0.22), transparent 60%), #0E1116;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.nav2__emblem { width: 64px; height: 64px; color: #D6A85A; }
.nav2__kicker { margin: 0.4rem 0 0; font: 600 0.66rem/1.3 'JetBrains Mono', monospace; letter-spacing: 0.14em; text-transform: uppercase; color: #F1D6A0; }
.nav2__lead { margin: 0; font-size: 0.86rem; line-height: 1.5; color: #B9B3A8; }

/* Right column: destination tiles */
.nav2__tiles { list-style: none; margin: 0; padding: 0.7rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; align-content: start; }
.nav2__tile {
    display: grid !important; grid-template-columns: 34px 1fr; column-gap: 0.7rem; align-items: center;
    padding: 0.6rem 0.65rem !important; border-radius: 12px; color: var(--color-text) !important; text-decoration: none;
    transition: background 0.18s;
}
.nav2__tile:hover, .nav2__tile:focus-visible { background: var(--color-background-alt, rgba(0, 0, 0, 0.04)); }
.nav2__tile:focus-visible { outline: 2px solid #D6A85A; outline-offset: -2px; }
.nav2__tile[aria-current="page"] { background: rgba(214, 168, 90, 0.12); }
.nav2__ico {
    grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    background: var(--color-background-alt, #F1F3F4); color: var(--color-text-secondary);
}
.nav2__ico svg { width: 18px; height: 18px; }
.nav2__ico img { width: 26px; height: 34px; object-fit: cover; border-radius: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.nav2__ico--cover { background: none; }
.nav2__t { font-size: 0.88rem; font-weight: 600; line-height: 1.25; }
.nav2__d { font-size: 0.76rem; line-height: 1.35; color: var(--color-text-secondary); }
.nav2__live { color: #2E8B57; font-weight: 600; }
.nav2__tile--wide { grid-column: 1 / -1; }

/* Jump button in the bar */
.nav2__jump {
    display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.55rem; cursor: pointer;
    font: inherit; font-size: 0.8rem; color: var(--color-text-secondary);
    background: var(--color-background-alt, #F1F3F4); border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08)); border-radius: 10px;
}
.nav2__jump:hover { color: var(--color-text); }
.nav2__jump svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.nav2__jump kbd, .nav2-jump kbd { font: 600 0.66rem 'JetBrains Mono', monospace; padding: 0.1rem 0.35rem; border-radius: 5px; border: 1px solid var(--color-border, rgba(0, 0, 0, 0.12)); background: var(--color-surface, #fff); }

/* Compact laptops: drop the Jump label, keep the icon */
@media (min-width: 1024px) and (max-width: 1240px) {
    .nav2__jump-label, .nav2__jump kbd { display: none; }
    .nav2__list { gap: 0.8rem; }
}

/* --------------------------------------------------------------------------
   Mobile: groups become an accordion inside the slide-down menu
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
    .header__nav.is-open { max-height: calc(100vh - 70px); overflow-y: auto; }
    .header__nav.is-open .nav2__trigger { width: 100%; justify-content: space-between; padding: 0.75rem 0.5rem; font-size: 1rem; }
    .nav2__panel { position: static; transform: none; width: auto; display: block; border: 0; box-shadow: none; border-radius: 12px; animation: none; background: transparent; }
    .nav2__panel::before { display: none; }
    .nav2__intro { display: none; }
    .nav2__tiles { grid-template-columns: 1fr; padding: 0 0 0.5rem 0.25rem; }
    .nav2__item.is-current > .nav2__trigger::after { display: none; }
    .nav2__jump-li { order: -1; }
    .nav2__jump { width: 100%; justify-content: flex-start; padding: 0.7rem; font-size: 0.95rem; }
    .nav2__jump kbd { display: none; }
}

/* --------------------------------------------------------------------------
   Jump to palette
   -------------------------------------------------------------------------- */
.nav2-jump { padding: 0; border: 0; background: transparent; width: min(560px, 92vw); max-width: 92vw; margin: 12vh auto auto; inset: 0; height: fit-content; }
.nav2-jump::backdrop { background: rgba(8, 10, 14, 0.55); backdrop-filter: blur(3px); }
.nav2-jump__box {
    background: var(--color-surface, #fff); color: var(--color-text); border-radius: 18px; overflow: hidden;
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08)); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5);
}
.nav2-jump__field { display: flex; align-items: center; gap: 0.7rem; padding: 0.95rem 1.1rem; border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.08)); }
.nav2-jump__field svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; opacity: 0.6; }
.nav2-jump__field input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1.05rem; color: inherit; }
.nav2-jump__list { list-style: none; margin: 0; padding: 0.4rem; max-height: 55vh; overflow-y: auto; }
.nav2-jump__list a { display: grid; gap: 0.1rem; padding: 0.65rem 0.8rem; border-radius: 10px; color: inherit; text-decoration: none; }
.nav2-jump__list [aria-selected="true"] a { background: rgba(214, 168, 90, 0.16); }
.nav2-jump__t { font-weight: 600; font-size: 0.92rem; }
.nav2-jump__d { font-size: 0.78rem; color: var(--color-text-secondary); }
.nav2-jump__none { padding: 1rem; color: var(--color-text-secondary); font-size: 0.9rem; }
.nav2-jump__hint { margin: 0; padding: 0.6rem 1.1rem; font-size: 0.72rem; color: var(--color-text-secondary); border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.08)); display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
    .nav2__panel, .nav2__chev { animation: none; transition: none; }
}
