/* Junction site chrome on Laravel pages — scoped so courses.css stays intact */

.jct-chrome {
    --jct-chrome-ink: #1a2332;
    --jct-chrome-muted: #5b6575;
    --jct-chrome-line: #e1e8ed;
    --jct-chrome-bg: #ffffff;
    --jct-chrome-accent: #088dcd;
    position: sticky;
    top: 0;
    z-index: 40;
}

.jct-chrome-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3.25rem;
    padding: max(0.5rem, env(safe-area-inset-top, 0px)) 0.75rem 0.5rem;
    background: var(--jct-chrome-bg);
    border-bottom: 1px solid var(--jct-chrome-line);
}

.jct-chrome-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.jct-chrome-logo img {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.45rem;
    object-fit: cover;
    display: block;
}

.jct-chrome-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
    color: var(--jct-chrome-ink);
    text-decoration: none;
}

.jct-chrome-user img {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.jct-chrome-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jct-chrome-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex: 0 0 auto;
    margin-left: auto;
}

.jct-chrome-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    background: transparent;
    color: var(--jct-chrome-ink);
    border-radius: 50%;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

.jct-chrome-icon:hover,
.jct-chrome-icon:focus-visible {
    background: rgba(8, 141, 205, 0.08);
    outline: none;
}

.jct-chrome-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.2rem;
    border-radius: 999px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
}

.jct-chrome-launcher {
    position: relative;
}

.jct-chrome-dropdown {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    min-width: 11rem;
    margin: 0;
    padding: 0.4rem 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--jct-chrome-line);
    border-radius: 0.65rem;
    box-shadow: 0 10px 28px rgba(26, 35, 50, 0.12);
    z-index: 50;
}

.jct-chrome-dropdown a {
    display: block;
    padding: 0.55rem 0.9rem;
    color: var(--jct-chrome-ink);
    text-decoration: none;
    font-size: 0.9rem;
}

.jct-chrome-dropdown a:hover {
    background: rgba(8, 141, 205, 0.08);
}

/* Secondary nav strip — always available so phone users can reach Home / Communities */
.jct-chrome-subnav {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.15rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: #fff;
    border-bottom: 1px solid var(--jct-chrome-line);
    padding: 0.2rem 0.35rem 0.35rem;
}

.jct-chrome-subnav::-webkit-scrollbar {
    display: none;
}

.jct-chrome-subnav a {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.55rem 0.25rem;
    color: var(--jct-chrome-muted);
    text-decoration: none;
    border-radius: 0.5rem;
}

.jct-chrome-subnav a.is-active,
.jct-chrome-subnav a:hover {
    color: var(--jct-chrome-accent);
    background: rgba(8, 141, 205, 0.06);
}

.jct-chrome-subnav svg {
    display: block;
}

/* Sidebar drawer */
.jct-chrome-scrim {
    position: fixed;
    inset: 0;
    background: rgba(26, 35, 50, 0.35);
    z-index: 45;
}

.jct-chrome-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(17rem, 86vw);
    z-index: 50;
    background: #f5f5f5;
    border-left: 1px solid var(--jct-chrome-line);
    padding: max(3.5rem, calc(env(safe-area-inset-top, 0px) + 2.5rem)) 0 1.5rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.28s ease;
}

.jct-chrome-sidebar.is-open {
    transform: translateX(0);
}

.jct-chrome-sidebar-close {
    position: absolute;
    top: max(0.85rem, env(safe-area-inset-top, 0px));
    left: 0.85rem;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--jct-chrome-ink);
}

.jct-chrome-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0 0.75rem;
}

.jct-chrome-sidebar-list a {
    display: block;
    padding: 0.7rem 0.85rem;
    color: var(--jct-chrome-ink);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 550;
    border-radius: 0.55rem;
}

.jct-chrome-sidebar-list a.is-active,
.jct-chrome-sidebar-list a:hover {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body.jct-chrome-lock {
    overflow: hidden;
}

/* Courses layout: drop the old Laravel-only header when chrome is present */
body.has-jct-chrome .site-header {
    display: none;
}

@media (min-width: 900px) {
    .jct-chrome-user-name {
        font-size: 0.95rem;
    }

    .jct-chrome-subnav a {
        min-width: 4.5rem;
        font-size: 0.75rem;
        padding: 0.55rem 0.35rem;
    }
}
