
/* GHA */

:root {
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;

    --background: #ffffff;
    --sidebar-background: #f8f9fa;
    --text: #222222;
    --muted: #6b7280;
    --border: #e5e7eb;
    --hover: #eeeeef;
    --active: #e7e9ec;
}

* {
    box-sizing: border-box;
}

html {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}


/* ==========================================
   PAGE LAYOUT
   ========================================== */

.layout {
    min-height: 100vh;
}

.content {
    min-height: 100vh;
    margin-left: var(--sidebar-width);

    transition: margin-left 0.2s ease;
}


/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;

    width: var(--sidebar-width);
    height: 100vh;

    display: flex;
    flex-direction: column;

    background: var(--sidebar-background);
    border-right: 1px solid var(--border);

    overflow: hidden;
    z-index: 100;

    transition:
        width 0.2s ease,
        transform 0.2s ease;
}


/* Sidebar header */

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;

    min-height: 64px;
    padding: 12px;

    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 10px;
    min-width: 0;

    text-decoration: none;
}

.brand-symbol {
    width: 32px;
    height: 32px;
    min-width: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #333333;
    color: white;

    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
}

.brand-name {
    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Sidebar buttons */

.icon-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;
    min-width: 32px;

    padding: 6px;
    border: 0;
    border-radius: 6px;

    background: transparent;
    color: var(--muted);
}

.icon-button:hover {
    background: var(--hover);
    color: var(--text);
}

.icon-button svg {
    display: block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

/* Desktop sidebar toggle */

#desktop-toggle {
    width: 24px;
    min-width: 24px;
    height: 32px;
    padding: 0;
    background: transparent;
}

#desktop-toggle:hover {
    background: transparent;
    color: var(--text);
}

#desktop-toggle svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;

    transition: transform 0.2s ease;
}

.is-collapsed #desktop-toggle svg {
    transform: rotate(180deg);
}


/* ==========================================
   SIDEBAR NAVIGATION
   ========================================== */

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;

    padding: 14px 10px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 12px;

    height: 40px;
    min-height: 40px;
    padding: 0 12px;

    border-radius: 6px;

    color: #525866;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;

    transition: background-color 0.15s ease;
}

.nav a:hover {
    background: var(--hover);
    color: var(--text);
}

.nav a[aria-current="page"] {
    background: var(--active);
    color: var(--text);
    font-weight: 600;
}

/* Keep every navigation icon small */

.nav svg {
    display: block;

    width: 18px;
    height: 18px;
    min-width: 18px;
    max-width: 18px;

    flex: 0 0 18px;
}

.nav-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 16px;

    border-top: 1px solid var(--border);

    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}


/* ==========================================
   COLLAPSED SIDEBAR
   ========================================== */

.layout.is-collapsed {
    --sidebar-width: var(--sidebar-collapsed-width);
}

.is-collapsed .sidebar-header {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0;

    padding: 12px 3px;
}

.is-collapsed .brand {
    flex: none;
    width: 32px;
    justify-content: center;
}

.is-collapsed .brand-name,
.is-collapsed .nav-label,
.is-collapsed .sidebar-bottom {
    display: none;
}

.is-collapsed .nav {
    padding: 12px 8px;
}

.is-collapsed .nav a {
    justify-content: center;
    padding: 0;
}

.is-collapsed .content {
    margin-left: var(--sidebar-collapsed-width);
}


/* ==========================================
   TOP HEADER
   ========================================== */

.header {
    display: flex;
    align-items: center;
    gap: 12px;

    height: 64px;
    padding: 0 32px;

    border-bottom: 1px solid var(--border);

    background: white;
    color: var(--muted);
    font-size: 13px;
}

/* Mobile menu hidden on desktop */

.mobile-menu,
#mobile-close {
    display: none;
}


/* ==========================================
   MAIN PAGE CONTENT
   ========================================== */

.main {
    width: 100%;
    max-width: 1000px;

    margin: 0 auto;
    padding: 48px 40px;
}

h1 {
    margin: 0 0 16px;

    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

h2 {
    margin: 0 0 16px;

    font-size: 17px;
    font-weight: 600;
}

p {
    line-height: 1.7;
}

.lead {
    margin: 0;
    max-width: 650px;

    color: var(--muted);
    font-size: 14px;
}

.section {
    margin-top: 48px;
}


/* ==========================================
   PAGE LINKS
   ========================================== */

.link-list {
    max-width: 650px;
    border-top: 1px solid var(--border);
}

.link-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    min-height: 56px;
    padding: 12px 4px;

    border-bottom: 1px solid var(--border);

    text-decoration: none;
    font-size: 14px;
}

.link-list a:hover {
    background: #fafafa;
}

.link-list small {
    color: var(--muted);
    font-size: 12px;
}

.page-note {
    max-width: 650px;
    margin-top: 40px;
    padding-top: 16px;

    border-top: 1px solid var(--border);

    color: var(--muted);
}


/* ==========================================
   MOBILE NAVIGATION
   ========================================== */

.mobile-backdrop {
    display: none;
}

@media (max-width: 700px) {

    .sidebar {
        width: 240px;
        transform: translateX(-100%);
    }

    .content,
    .is-collapsed .content {
        margin-left: 0;
    }

    .header {
        padding: 0 20px;
    }

    .mobile-menu,
    #mobile-close {
        display: flex;
    }

    .main {
        padding: 32px 20px;
    }

    h1 {
        font-size: 24px;
    }

    /* Ignore desktop collapsed styling on mobile */

    .is-collapsed .sidebar-header {
      flex-direction: row;
      justify-content: flex-start;
      gap: 8px;
      padding: 12px;
    }

    .is-collapsed .brand {
        flex: 1;
        width: auto;
        justify-content: flex-start;
    }

    .is-collapsed .brand-name,
    .is-collapsed .nav-label {
        display: block;
    }

    .is-collapsed .sidebar-bottom {
        display: block;
    }

    .is-collapsed .nav {
        padding: 14px 10px;
    }

    .is-collapsed .nav a {
        justify-content: flex-start;
        padding: 0 12px;
    }

    #desktop-toggle {
        display: none;
    }

    /* Open drawer */

    .layout.mobile-open .sidebar {
        transform: translateX(0);
    }

    .layout.mobile-open .mobile-backdrop {
        display: block;
        position: fixed;
        inset: 0;

        background: rgba(0, 0, 0, 0.3);
        z-index: 90;
    }

    .link-list a {
        gap: 12px;
    }
}

/* ==========================================
   NOTES LIST
   ========================================== */

.notes-list {
    padding-left: 20px;
}

.notes-list li {
    line-height: 1.7;
}

.notes-list li + li {
    margin-top: 20px;
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

@media (prefers-reduced-motion: reduce) {

    .sidebar,
    .content,
    .nav a,
    #desktop-toggle svg {
        transition: none;
    }
}
