/* Hub-wide navigation layout — paired with /onboarding/_nav.js
   Wraps each page in a 2-column grid: sidebar + content. On <920px viewports,
   the sidebar collapses to a top block. */

.layout {
    max-width: 1084px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 220px minmax(0, 760px);
    gap: 2.5rem;
    justify-content: center;
    align-items: start;
}

/* The existing inline .wrapper used to be the page's outer container with
   max-width 760 + auto margins. Inside .layout, the grid column already
   constrains width — so cancel max-width and margins, but keep its padding. */
.layout > .wrapper {
    max-width: none;
    margin: 0;
}

/* Sidebar */
.hub-nav {
    position: sticky;
    top: 4rem;
    padding-top: 3rem;
    font-size: 0.88rem;
    line-height: 1.4;
}

.hub-nav-section {
    margin-bottom: 1.6rem;
}
.hub-nav-section:last-child {
    margin-bottom: 0;
}

.hub-nav-label {
    font-family: 'Geist', -apple-system, system-ui, sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(0, 0, 0, 0.45);
    margin-bottom: 0.6rem;
}

.hub-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hub-nav-list li {
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

.hub-nav-list a {
    color: #666666;
    text-decoration: none;
    border-bottom: none;
    display: block;
    padding: 0.3rem 0 0.3rem 0.85rem;
    border-left: 2px solid transparent;
    margin-left: -0.85rem;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.hub-nav-list a:hover {
    color: #CD584B;
}

.hub-nav-list li.active > a {
    color: #111111;
    font-weight: 600;
    border-left-color: #CD584B;
    background: rgba(205, 88, 75, 0.06);
    border-radius: 0 4px 4px 0;
}

/* Right-side nav grouping (section-back + Hub link) */
.nav-bar > .nav-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

/* Section-back link in the top nav-bar (e.g., "← Attribution") */
.section-back-link {
    font-family: 'Geist', -apple-system, system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #111111;
    text-decoration: none;
    transition: color 0.15s ease;
}
.section-back-link:hover {
    color: #CD584B;
}

/* "← Hub" arrow pattern — default shows arrow; section-back-link overrides */
.nav-back::before {
    content: '← ';
    color: rgba(0, 0, 0, 0.45);
}
#section-back-link:not(:empty) + .nav-back {
    padding-left: 0.85rem;
    border-left: 1px solid rgba(0, 0, 0, 0.12);
}
#section-back-link:not(:empty) + .nav-back::before {
    content: '';
}

/* Footer "More in this section" block */
.footer-more {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1.5rem 0 0.25rem;
    margin-top: 2.5rem;
}
.footer-more-label {
    font-family: 'Geist', -apple-system, system-ui, sans-serif;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(0, 0, 0, 0.45);
    margin-bottom: 0.75rem;
}
.footer-more-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
}
.footer-more-list li { margin: 0; padding: 0; }
.footer-more-list a {
    color: #111111;
    text-decoration: none;
    font-size: 0.92rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.footer-more-list a:hover {
    color: #CD584B;
    border-bottom-color: #CD584B;
}

.hub-nav-list li.child > a {
    padding-left: 1.5rem;
    font-size: 0.85rem;
}

/* "Updated [date] — see what changed" line injected into .header-meta by _nav.js */
.header-updated {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.74rem;
    color: rgba(0, 0, 0, 0.45);
    letter-spacing: 0.02em;
}
.header-updated a {
    color: rgba(0, 0, 0, 0.55);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-left: 0.4rem;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.header-updated a:hover {
    color: #CD584B;
    border-bottom-color: #CD584B;
}

/* Mobile — sidebar collapses to a block above content */
@media (max-width: 920px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 0;
        max-width: 760px;
        padding: 0;
    }
    .hub-nav {
        position: static;
        padding: 1.25rem 1.25rem;
        margin: 1rem 1.5rem 0;
        background: #f5f5f5;
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 8px;
    }
    .hub-nav-section {
        margin-bottom: 1rem;
    }
}

@media (max-width: 600px) {
    .hub-nav {
        margin: 0.5rem 1rem 0;
    }
}
