/* Section spacing must live in a layer ABOVE @layer reset. The reset zeroes
   h1–h6 margins (app-reset.css), so a margin on .app-section-title (an <h3>)
   placed in @layer legacy loses to it — that's why titles showed no gap.
   @layer components beats reset, matching where .c-page__title lives. */
@layer components {
    /* Every section ALWAYS owns the gap above itself, so it separates from
       whatever precedes it — a page title, another section, or the page top —
       with no edge cases. --space-6 (32px) is ~2× the title's content gap below,
       which reads as a clear section break without the airiness of --space-7. */
    .app-section {
        margin-top: var(--space-6);
    }
    /* Heading owns ONLY the gap to its own content. */
    .app-section-title {
        margin-bottom: var(--space-4);
    }
}

@layer legacy {


.app-section {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
}

.app-section-inner-right {
    align-items: flex-end;
    justify-content: flex-end;
}

.app-section-overlay {
    background-color: transparent;
    color: white;
    justify-content: center;
    height: 100%;
}

.app-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: clamp(1.25rem, 2.5vw, 18.72px);
}
/* Optional <app-section icon="…"> glyph — muted, sits left of the title. Only
   present when the section supplies an icon, so this never affects plain titles. */
.app-section-title i {
    color: var(--color-ink-mute);
}
.app-subsection-title {
    font-size: clamp(1.125rem, 2vw, 16px);
}

.app-section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 0 40px 0;
    width: 100%;
}

    .app-section-header h1 {
        font-size: clamp(2rem, 5vw, 56px);
    }

    .app-section-header h2 {
        text-align: center;
        margin: 0 auto;
    }

    .app-section-header h3 {
        text-align: center;
        margin: 0 auto;
    }

    .app-section-header p {
        font-size: var(--app-section-subtitle-font-size, 1.25rem);
        max-width: var(--app-section-subtitle-width, 50%);
        margin: 0 auto;
        margin-top: 20px;
    }
.app-section-subheader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 0 40px 0;
    width: 100%;
}

.app-hero-section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 0 40px 0;
    width: 100%;
}

    .app-hero-section-header h1 {
        font-size: clamp(2rem, 5vw, 56px);
        text-align: center;
        margin: 0 auto;
    }


.app-subsection-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    margin: 0 auto;
}

.app-section-h1 {
    font-size: clamp(1.75rem, 3.5vw, 32px);
}

.app-section-h2 {
    font-size: clamp(1.5rem, 3vw, 24px);
}

.app-section-h3 {
    font-size: clamp(1.25rem, 2.5vw, 18.72px);
}

.app-section-h4 {
    font-size: clamp(1.125rem, 2vw, 16px);
}

.app-section-h5 {
    font-size: clamp(1rem, 1.5vw, 13.28px);
}

.app-section-h6 {
    font-size: clamp(0.95rem, 1.2vw, 10.72px);
}

.app-section-footer {
    border-top: 1pt solid lightgray;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    margin-top: 10px;
}
.app-section-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    margin-top: 10px;
}
    .app-section-buttons {
        display: flex;
        flex-direction: row;
        align-items: flex-end;
        justify-content: flex-start;
        width: 100%;
        margin-top: 10px;
        margin-bottom: 10px;
        gap: 10px;
    }
.app-section-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
}

.app-section-card-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    gap: 1em;
    padding-top: 10px;
    padding-bottom: 10px;
}
.app-section-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background-color: var(--app-background-color-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 400px;
}

    .app-section-card h3 {
        margin-bottom: 15px;
    }


.app-section-dashboard {
    display:block;
    width: 100%;
}

.app-context-header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    padding-bottom: 5px;
    width: 100%;
}
.app-context-header-fields {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    column-gap: 20px; /* gap BETWEEN pairs */
    width: 100%;
}
.app-context-header-field-label {
    display: inline-block;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.app-context-header-field-value {
    display: inline-block;
    margin: 0;
    font-size: 14px;
    font-weight: normal;
}
}
