/*
 * Global document and typography rules.
 * Page-specific layout belongs in the corresponding page stylesheet.
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--color-background);
    color-scheme: dark;
}

body {
    min-width: var(--viewport-min-width);
    min-height: 100vh;
    min-height: 100dvh;
    margin: var(--space-0);
    overflow-x: hidden;
    background: var(--color-background);
    color: var(--color-primary);
    font-family: var(--font-family-base);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body[data-overlay-open="true"] {
    overflow: hidden;
}

[hidden] {
    display: none !important;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
p {
    margin: var(--space-0);
}

h1 {
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--font-spacing-h1);
    line-height: var(--line-height-tight);
}

h2 {
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--font-spacing-h2);
    line-height: var(--line-height-tight);
}

h3 {
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--font-spacing-h3);
    line-height: var(--line-height-tight);
}

.site-shell {
    display: flex;
    width: 100%;
    max-width: var(--page-max-width);
    min-height: 100vh;
    min-height: 100dvh;
    margin-inline: auto;
    padding:
        var(--page-padding-top)
        var(--page-padding-inline)
        var(--page-padding-bottom);
    flex-direction: column;
}

.site-main {
    flex: 1;
    padding-top: calc(
        var(--site-header-block-size)
        + var(--space-6)
        - var(--page-padding-top)
    );
}

.page-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-4);
}

.page-heading__icon {
    width: var(--icon-size-lg);
    height: var(--icon-size-lg);
    flex: 0 0 auto;
    object-fit: contain;
}

.page-heading__label {
    overflow: hidden;
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--font-spacing-h1);
    line-height: var(--line-height-tight);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-label {
    margin-bottom: var(--space-4);
    color: var(--color-tertiary);
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--font-spacing-h3);
    text-transform: uppercase;
}

.muted-text {
    color: var(--color-secondary);
    font-size: var(--font-size-body-small);
}

.empty-state {
    padding: var(--space-6) var(--space-5);
    border: var(--card-border-width) solid var(--color-border);
    border-radius: var(--radius-card);
    color: var(--color-tertiary);
    font-size: var(--font-size-body-small);
    text-align: center;
}

.flash-messages {
    display: grid;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.flash-message {
    padding: var(--space-3) var(--space-4);
    border: var(--card-border-width) solid var(--color-border-active);
    border-radius: var(--radius-control);
    background: var(--color-surface);
    color: var(--color-primary);
    font-size: var(--font-size-body-small);
}

@media (min-width: 64rem) {
    .section-label {
        margin-bottom: var(--space-3);
        color: var(--color-tertiary);
        font-size: var(--font-size-h3);
        font-weight: var(--font-weight-semibold);
        letter-spacing: var(--font-spacing-h3);
        text-transform: uppercase;
    }
}
