/* Layout and a few touches on top of Web Awesome's default theme, shared by
   the public landing page and the /app/ pages. Colours come from Web
   Awesome's tokens, so they follow light and dark mode by themselves. */

/* Web Awesome components set their own display, which would otherwise beat
   the hidden attribute. */
[hidden] {
    display: none !important;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--wa-color-surface-lowered);
}

/* --- Header and navigation --- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--wa-color-surface-default);
    border-bottom: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border);
}

.site-header-inner {
    display: flex;
    align-items: center;
    gap: var(--wa-space-m);
    max-width: 84rem;
    margin: 0 auto;
    padding: var(--wa-space-xs) var(--wa-space-m);
}

.logo {
    color: var(--wa-color-brand-on-quiet);
    font-size: var(--wa-font-size-l);
    font-weight: var(--wa-font-weight-bold);
    letter-spacing: -0.02em;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    flex: 1;
    gap: var(--wa-space-3xs);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: var(--wa-space-xs);
    padding: var(--wa-space-xs) var(--wa-space-s);
    border-radius: var(--wa-border-radius-m);
    color: var(--wa-color-text-quiet);
    font-size: var(--wa-font-size-s);
    font-weight: var(--wa-font-weight-semibold);
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--wa-color-neutral-fill-quiet);
    color: var(--wa-color-text-normal);
}

.nav-link[aria-current="page"] {
    background: var(--wa-color-brand-fill-quiet);
    color: var(--wa-color-brand-on-quiet);
}

.drawer-nav .nav-link {
    font-size: var(--wa-font-size-m);
    padding: var(--wa-space-s);
}

.user-menu {
    margin-left: auto;
}

.user-card {
    display: flex;
    flex-direction: column;
    max-width: 20rem;
    padding: var(--wa-space-xs) var(--wa-space-m);
    overflow-wrap: anywhere;
}

.nav-toggle {
    display: none;
}

/* Too narrow for every link: move them into the drawer. */
@media (max-width: 1100px) {
    .site-nav {
        display: none;
    }
    .nav-toggle {
        display: inline-flex;
    }
}

.user-name {
    display: inline-block;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

/* Room for the links, or (on phones) the logo: show just the user icon. */
@media (max-width: 1320px) and (min-width: 1101px), (max-width: 480px) {
    .user-name {
        display: none;
    }
}

.sample-banner {
    box-sizing: border-box;
    width: 100%;
    max-width: 84rem;
    margin: var(--wa-space-m) auto 0;
    padding: 0 var(--wa-space-m);
}

/* --- Page content --- */

main.page {
    box-sizing: border-box;
    flex: 1;
    width: 100%;
    max-width: 84rem;
    margin: 0 auto;
    padding: var(--wa-space-xl) var(--wa-space-m) var(--wa-space-3xl);
}

main.page.narrow {
    max-width: 56rem;
}

.page-header {
    margin-bottom: var(--wa-space-xl);
}

.page-header h1 {
    margin: 0 0 var(--wa-space-2xs);
}

.page-header p {
    max-width: 48rem;
    margin: 0;
    color: var(--wa-color-text-quiet);
}

h2.section-title {
    margin: 0;
    font-size: var(--wa-font-size-l);
}

.quiet {
    color: var(--wa-color-text-quiet);
}

/* Wide tables scroll sideways on phones instead of the whole page. */
.table-scroll {
    overflow-x: auto;
}

table.data {
    width: 100%;
    margin: 0;
}

.table-scroll table.data {
    min-width: 36rem;
}

table.data th,
table.data td {
    vertical-align: top;
}

table.data .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

table.data .nowrap {
    white-space: nowrap;
}

.empty-state {
    padding: var(--wa-space-2xl) var(--wa-space-m);
    text-align: center;
    color: var(--wa-color-text-quiet);
}

.empty-icon {
    font-size: 2rem;
}

dl.facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--wa-space-2xs) var(--wa-space-m);
    margin: 0;
}

dl.facts dt {
    color: var(--wa-color-text-quiet);
}

dl.facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* --- Forms --- */

.form-section {
    display: flex;
    flex-direction: column;
    gap: var(--wa-space-l);
}

fieldset.collection-choices {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
}

/* A file picker: Web Awesome has no free file-input component. */
.file-field {
    display: flex;
    flex-direction: column;
    gap: var(--wa-space-2xs);
}

.file-field label {
    font-weight: var(--wa-form-control-label-font-weight);
}

.file-field input[type="file"] {
    padding: var(--wa-space-xs);
    border: var(--wa-border-width-s) dashed var(--wa-color-surface-border);
    border-radius: var(--wa-form-control-border-radius);
    background: var(--wa-color-surface-default);
    color: var(--wa-color-text-normal);
    font: inherit;
}

.hint {
    color: var(--wa-color-text-quiet);
    font-size: var(--wa-font-size-s);
}

pre.result {
    max-height: 24rem;
    margin: 0;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: var(--wa-font-size-xs);
}

/* --- File trees --- */

.tree-box {
    max-height: 30rem;
    overflow: auto;
    padding: var(--wa-space-xs);
    border: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border);
    border-radius: var(--wa-border-radius-m);
    background: var(--wa-color-surface-default);
}

.tree-box wa-tree {
    --indent-guide-width: 1px;
}

.tree-box wa-tree-item::part(label) {
    flex: 1;
    min-width: 0;
}

.tree-label {
    display: flex;
    flex: 1;
    align-items: center;
    gap: var(--wa-space-xs);
    min-width: 0;
}

.tree-label .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-label .size {
    margin-left: auto;
    padding-left: var(--wa-space-m);
    color: var(--wa-color-text-quiet);
    font-size: var(--wa-font-size-xs);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tree-summary {
    font-size: var(--wa-font-size-s);
    color: var(--wa-color-text-quiet);
}

/* --- Landing page --- */

.hero {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--wa-space-l);
    padding: var(--wa-space-4xl) var(--wa-space-m);
    text-align: center;
}

.hero h1 {
    margin: 0;
    color: var(--wa-color-brand-on-quiet);
    font-size: var(--wa-font-size-4xl);
    letter-spacing: -0.02em;
}

.hero p {
    max-width: 40rem;
    margin: 0;
    color: var(--wa-color-text-quiet);
}

/* --- Privacy policy and terms of service --- */

main.legal h2 {
    margin: var(--wa-space-xl) 0 var(--wa-space-s);
    font-size: var(--wa-font-size-l);
}

main.legal li + li {
    margin-top: var(--wa-space-xs);
}

/* --- Footer --- */

.site-footer {
    padding: var(--wa-space-xl) var(--wa-space-m);
    border-top: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border);
    background: var(--wa-color-surface-default);
    color: var(--wa-color-text-quiet);
    font-size: var(--wa-font-size-xs);
    text-align: center;
}

.site-footer a {
    color: inherit;
}

/* --- Home page --- */

a.action-card {
    color: inherit;
    text-decoration: none;
}

a.action-card wa-card {
    height: 100%;
    transition: border-color var(--wa-transition-fast);
}

a.action-card:hover wa-card {
    border-color: var(--wa-color-brand-border-normal);
}

.action-icon {
    color: var(--wa-color-brand-on-quiet);
    font-size: 1.5rem;
}
