/* Shared page-layout primitives.
 *
 * These classes (page-header, content-card, flash-message, …) were historically
 * redefined in nearly every package stylesheet. They are promoted here so any
 * page gets consistent styling for free. Values use the global tokens from
 * style.css. Loaded globally in _header.html immediately after style.css, so a
 * package stylesheet (loaded later) can still override any of these locally.
 */

/* Page Header */
.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.page-title-section {
    /* Grow/shrink to fill the row; min-width:0 lets the title wrap instead of
       forcing the actions to squish. */
    flex: 1 1 auto;
    min-width: 0;
}

.page-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-strong);
    margin: 0 0 var(--spacing-sm) 0;
    line-height: var(--leading-tight);
}

.page-subtitle {
    font-size: var(--text-md);
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    /* Keep buttons at their natural size; when the row is too narrow the whole
       group wraps to its own line rather than squishing the buttons. */
    flex-shrink: 0;
}

/* Content Card */
.content-card {
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Flash Messages */
.flash-message {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
    border-left: 4px solid;
}

.flash-message.error {
    background: var(--error-light-bg);
    color: var(--error-color);
    border-left-color: var(--error-color);
}

.flash-message.success {
    background: var(--success-light-bg);
    color: var(--success-color);
    border-left-color: var(--success-color);
}

.flash-message.warning {
    background: var(--warning-amber-bg);
    color: var(--warning-amber-text);
    border-left-color: var(--warning-amber);
}

.flash-message.info {
    background: var(--info-light-bg);
    color: var(--info-text-color);
    border-left-color: var(--info-color);
}

.flash-icon {
    font-size: var(--text-lg);
}
