/*
 * AspecLibrary
 * CSS público da Razor Class Library.
 */

@import "./tokens.css";
@import "./themes/light.css";
@import "./themes/dark.css";
@import "./aspec-library.utilities.css";
@import "./responsive.css";

[data-aspec-theme="light"] {
    color-scheme: light;
}

[data-aspec-theme="dark"] {
    color-scheme: dark;
}

html[data-aspec-theme],
html[data-aspec-theme] body {
    background-color: var(--aspec-color-background);
    color: var(--aspec-color-foreground);
}

[data-aspec-theme] {
    background-color: var(--aspec-color-background);
    color: var(--aspec-color-foreground);
}

.aspec-focus-ring {
    outline: var(--aspec-focus-ring-width) solid var(--aspec-color-focus);
    outline-offset: var(--aspec-focus-ring-offset);
}

.aspec-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/*
 * AspecHeader também é publicado no CSS global para consumidores que não
 * agregam automaticamente o CSS isolation da Razor Class Library.
 */
.aspec-header {
    box-sizing: border-box;
    width: 100%;
    padding: 1.25rem;
    border: 1px solid var(--aspec-color-border-soft, #dbe3ec);
    border-radius: var(--aspec-radius-lg, .75rem);
    background: var(--aspec-color-surface, #fff);
    color: var(--aspec-color-foreground, #172033);
}

.aspec-header--default {
    border-width: 0 0 1px;
    border-radius: 0;
    padding-inline: 0;
}

.aspec-header--surface {
    box-shadow: var(--aspec-shadow-sm, 0 1px 3px rgb(15 23 42 / .12));
}

.aspec-header--accent {
    border-left: .25rem solid var(--aspec-color-primary, #2563eb);
}

.aspec-header--compact {
    padding-block: .75rem;
}

.aspec-header--sticky {
    position: sticky;
    top: 0;
    z-index: 30;
}

.aspec-header__breadcrumbs {
    margin-bottom: .75rem;
    overflow-x: auto;
}

.aspec-header__main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.aspec-header__content {
    min-width: 0;
    flex: 1 1 auto;
}

.aspec-header__heading-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .625rem;
}

.aspec-header__title {
    margin: 0;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    line-height: 1.2;
    font-weight: 700;
}

.aspec-header__description {
    margin: .375rem 0 0;
    color: var(--aspec-color-muted-foreground, #64748b);
    line-height: 1.5;
}

.aspec-header__metadata,
.aspec-header__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.aspec-header__custom {
    margin-top: .75rem;
}

.aspec-header__heading-row:empty + .aspec-header__custom {
    margin-top: 0;
}

.aspec-header__actions {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.aspec-header--actions-inline .aspec-header__main {
    align-items: center;
}

@media (max-width: 40rem) {
    .aspec-header {
        padding: 1rem;
    }

    .aspec-header--default {
        padding-inline: 0;
    }

    .aspec-header__main {
        flex-direction: column;
    }

    .aspec-header__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .aspec-header--actions-inline .aspec-header__main {
        flex-direction: row;
        align-items: center;
    }

    .aspec-header--actions-inline .aspec-header__content {
        flex: 1 1 auto;
    }

    .aspec-header--actions-inline .aspec-header__actions {
        width: auto;
        justify-content: flex-end;
    }
}

@media (prefers-color-scheme: dark) {
    :root:not([data-aspec-theme="light"]) .aspec-header {
        --aspec-color-surface: #111827;
        --aspec-color-foreground: #f8fafc;
        --aspec-color-muted-foreground: #aebbd0;
        --aspec-color-border-soft: #334155;
    }
}
/*
 * AspecCard também é publicado no CSS global para consumidores que não
 * agregam automaticamente o CSS isolation da Razor Class Library.
 */
.aspec-card {
    box-sizing: border-box;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--aspec-color-border-soft, #dbe3ec);
    border-radius: var(--aspec-radius-lg, .75rem);
    background: var(--aspec-color-surface, #fff);
    color: var(--aspec-color-foreground, #172033);
    box-shadow: var(--aspec-shadow-sm, 0 1px 3px rgb(15 23 42 / .12));
}

.aspec-card__header {
    display: flex;
    flex-direction: column;
    gap: .375rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--aspec-color-border-soft, #dbe3ec);
    background: var(--aspec-color-surface-soft, #f8fafc);
}

.aspec-card__title {
    margin: 0;
    color: var(--aspec-color-foreground, #172033);
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.35;
}

.aspec-card__description {
    margin: 0;
    color: var(--aspec-color-muted-foreground, #64748b);
    font-size: .875rem;
    line-height: 1.5;
}

.aspec-card__content {
    min-width: 0;
    flex: 1 1 auto;
    padding: 1.25rem;
}

.aspec-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--aspec-color-border-soft, #dbe3ec);
    background: var(--aspec-color-surface-soft, #f8fafc);
}

@media (max-width: 40rem) {
    .aspec-card__header,
    .aspec-card__content {
        padding: 1rem;
    }

    .aspec-card__footer {
        justify-content: stretch;
        padding: .875rem 1rem;
    }
}
/* Estrutura de formulários disponível também no CSS global da RCL. */
.aspec-form {
    box-sizing: border-box;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1.25rem;
    color: var(--aspec-color-foreground, #172033);
}

.aspec-form-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--aspec-color-border-soft, #dbe3ec);
}

.aspec-form-header__content {
    min-width: 0;
    flex: 1 1 auto;
}

.aspec-form-header__title {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
}

.aspec-form-header__description,
.aspec-form-section__description {
    margin: .375rem 0 0;
    color: var(--aspec-color-muted-foreground, #64748b);
    font-size: .875rem;
    line-height: 1.5;
}

.aspec-form-header__actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.aspec-form-section {
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid var(--aspec-color-border-soft, #dbe3ec);
    border-radius: var(--aspec-radius-lg, .75rem);
    background: var(--aspec-color-surface, #fff);
    box-shadow: var(--aspec-shadow-sm, 0 1px 3px rgb(15 23 42 / .12));
}

.aspec-form-section__header {
    margin-bottom: 1rem;
}

.aspec-form-section__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.4;
}

.aspec-form-section__content {
    display: grid;
    min-width: 0;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr);
}

.aspec-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    width: 100%;
}

.aspec-form-actions--start {
    justify-content: flex-start;
}

.aspec-form-actions--center {
    justify-content: center;
}

.aspec-form-actions--end {
    justify-content: flex-end;
}

.aspec-form-actions--between {
    justify-content: space-between;
}

.aspec-form-footer {
    display: flex;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--aspec-color-border-soft, #dbe3ec);
}

@media (min-width: 48rem) {
    .aspec-form-section__content--two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .aspec-form-section__content--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .aspec-form-section__content--four {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 40rem) {
    .aspec-form-header {
        flex-direction: column;
    }

    .aspec-form-header__actions {
        width: 100%;
    }

    .aspec-form-section {
        padding: 1rem;
    }
}