/* The two frames pages live in: the application (templates/layout/app) and the pages before logging in (layout/auth). */

/* --- Wordmark ------------------------------------------------------------- */

.brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.brand:hover {
    color: var(--ink);
    text-decoration: none;
}

.brand .icon {
    color: var(--moss);
}

/* --- Application: the sidebar ------------------------------------------------ */

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex: 0 0 15.5rem;
    flex-direction: column;
    gap: 1.375rem;
    height: 100vh;
    padding: 1.25rem 0.875rem;
    overflow-y: auto;
    border-right: 1px solid var(--thread);
    background: var(--linen);
}

.sidebar .brand {
    padding: 0.375rem 0.625rem;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-heading {
    margin-bottom: 0.375rem;
    padding: 0 0.75rem;
    color: var(--bark);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.6875rem 0.75rem;
    border-radius: var(--radius-small);
    color: var(--ink-soft);
    font-size: 0.875rem;
}

.sidebar-link:hover {
    background: rgb(42 36 31 / 0.05);
    color: var(--ink);
    text-decoration: none;
}

.sidebar-link[aria-current='page'] {
    background: var(--moss-mist);
    color: var(--moss-deep);
    font-weight: 600;
}

.sidebar-link[aria-current='page'] .icon,
.sidebar-link[aria-current='page'] .sidebar-count {
    color: var(--moss);
}

.sidebar-count {
    margin-left: auto;
    color: var(--bark);
    font-size: 0.75rem;
    font-weight: 500;
}

/* The user, leading to their settings. */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-top: auto;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-small);
    color: var(--ink);
}

.sidebar-user .icon {
    margin-left: auto;
    color: var(--bark);
}

.sidebar-user:hover {
    background: rgb(42 36 31 / 0.05);
    color: var(--ink);
    text-decoration: none;
}

.sidebar-user[aria-current='page'] {
    background: var(--moss-mist);
    color: var(--moss-deep);
}

.sidebar-user[aria-current='page'] .icon {
    color: var(--moss);
}

.avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 50%;
    background: var(--moss);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
}

.sidebar-who {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.sidebar-who span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.current-user {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.sidebar-email {
    color: var(--bark);
    font-size: 0.75rem;
}

/* --- Application: the page --------------------------------------------------- */

.app-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1.375rem 2rem;
    border-bottom: 1px solid var(--thread);
}

.page-header h1 {
    font-size: 1.875rem;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    color: var(--bark);
    font-size: 0.875rem;
    font-weight: 500;
}

.breadcrumbs .icon {
    color: var(--bark-light);
}

.breadcrumbs [aria-current] {
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search {
    position: relative;
    flex: 1 1 16.25rem;
    max-width: 28.75rem;
    margin-left: auto;
}

.search .icon {
    position: absolute;
    top: 50%;
    left: 0.875rem;
    color: var(--bark-light);
    transform: translateY(-50%);
    pointer-events: none;
}

.search input {
    padding-left: 2.625rem;
    background: var(--paper);
}

.page-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem 2rem 2.5rem;
}

/* On narrow screens the sidebar folds into a bar above the page. */
@media (max-width: 48rem) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        flex: none;
        flex-flow: row wrap;
        align-items: center;
        gap: 0.25rem 0.75rem;
        height: auto;
        padding: 0.625rem 1rem;
        border-right: 0;
        border-bottom: 1px solid var(--thread);
    }

    .sidebar .brand {
        margin-right: auto;
        padding-left: 0;
    }

    .sidebar-heading,
    .sidebar-email {
        display: none;
    }

    .sidebar-link {
        padding: 0.5rem 0.75rem;
    }

    /* The wordmark and the user in one row, the navigation below. */
    .sidebar-section {
        flex-direction: row;
        order: 1;
    }

    .sidebar-section:first-of-type {
        flex-basis: 100%;
    }

    .sidebar-user {
        margin: 0;
        padding: 0.25rem;
    }

    .page-header {
        padding: 1rem;
    }

    .page-header h1,
    .breadcrumbs {
        flex: 1;
    }

    /* The search moves below the title and the main action. */
    .search {
        flex-basis: 100%;
        order: 1;
        max-width: none;
    }

    .page-content {
        padding: 1rem 1rem 2rem;
    }
}

/* --- Before logging in --------------------------------------------------------- */

.auth {
    display: flex;
    flex-wrap: wrap;
    min-height: 100vh;
}

.auth-aside {
    display: flex;
    flex: 1 1 26.25rem;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: var(--moss);
    color: var(--parchment);
}

.auth-aside .brand {
    gap: 0.75rem;
    padding: 2.5rem 3rem 0.5rem;
    color: inherit;
    font-size: 1.75rem;
}

.auth-aside .brand .icon {
    color: inherit;
}

.auth-illustration {
    display: block;
    width: 100%;
    height: auto;
}

.auth-pitch {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 1.375rem;
    padding: 1.75rem 3rem 2.5rem;
}

.auth-badge {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background: var(--moss-night);
}

.auth-headline {
    max-width: 30rem;
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.auth-lead {
    max-width: 30rem;
    color: var(--moss-light);
    font-size: 1rem;
    line-height: 1.6;
}

.auth-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.125rem;
    margin-top: auto;
    padding: 1.5rem 0 0;
    color: var(--moss-light-dim);
    font-size: 0.8125rem;
    list-style: none;
}

.auth-main {
    display: flex;
    flex: 1 1 26.25rem;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 3rem 2rem;
}

.auth-card {
    display: flex;
    flex-direction: column;
    gap: 1.375rem;
    width: 100%;
    max-width: 26.25rem;
    padding: 2.25rem;
    border: 1px solid var(--thread);
    border-radius: var(--radius-modal);
    background: var(--paper);
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 1.375rem;
}

.auth-heading h1 {
    margin-bottom: 0.375rem;
    font-size: 1.875rem;
}

.auth-heading p,
.auth-note,
.auth-alternative {
    color: var(--bark);
    font-size: 0.875rem;
}

.auth-alternative {
    text-align: center;
}

.auth-alternative a {
    font-weight: 600;
}

/* On narrow screens the form matters most: what Paperbrook is shrinks to the wordmark, the picture and one line. */
@media (max-width: 54rem) {
    .auth-aside .brand {
        padding: 1.5rem 1.5rem 0;
    }

    .auth-pitch {
        padding: 1rem 1.5rem 1.75rem;
    }

    .auth-headline {
        font-size: 1.75rem;
    }

    .auth-badge,
    .auth-lead,
    .auth-features {
        display: none;
    }

    .auth-main {
        padding: 1.5rem 1rem 2.5rem;
    }

    .auth-card {
        padding: 1.5rem;
    }
}
