/*
 * Unified type and control scale for the artist portal.
 * Loaded after every page stylesheet so each module shares the same sizes.
 * Design canvases (Linkfolio preview, QR poster, font samples) are excluded on purpose.
 */
body.artist-private-body {
    --artist-text-base: 0.875rem;
    --artist-text-md: 0.8125rem;
    --artist-text-sm: 0.75rem;
    --artist-weight-regular: 400;
    --artist-weight-strong: 600;
    --artist-control-height: 42px;
    --artist-control-height-compact: 32px;
    --artist-control-radius: 6px;
    --artist-section-title-size: 1.125rem;
}

/* Standard buttons: 13px / 600 / 42px */
body.artist-private-body :is(.artist-private-main, .modal) :is(
    .finance-button:not(.finance-camera-action),
    .atk-button,
    .agenda-button,
    .artist-portal-primary-action,
    .artist-portal-secondary-action,
    .artist-portal-media-action:not(.artist-portal-media-action--small),
    .artist-portal-music-action,
    .artist-portal-setlist-action,
    .artist-portal-logo-action,
    .artist-contact-tool-button,
    .btn:not(.btn-sm, .btn-lg)
):not(:is([data-linkfolio-preview], .artist-qr-preview-paper, .artist-font-picker-sample) *) {
    min-height: var(--artist-control-height) !important;
    height: var(--artist-control-height) !important;
    padding-block: 0.72rem !important;
    font-size: var(--artist-text-md) !important;
    font-weight: var(--artist-weight-strong) !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    border-radius: var(--artist-control-radius);
}

/* Compact buttons (row actions): 12px / 600 / 32px */
body.artist-private-body :is(.artist-private-main, .modal) :is(
    .artist-events-action,
    .artist-private-event-action,
    .artist-venues-row__action,
    .artist-portal-media-action--small,
    .artist-portal-setlist-row__action,
    .artist-portal-setlist-row__menu-button,
    .btn-sm
):not(:is([data-linkfolio-preview], .artist-qr-preview-paper, .artist-font-picker-sample) *) {
    min-height: var(--artist-control-height-compact) !important;
    min-width: var(--artist-control-height-compact) !important;
    height: var(--artist-control-height-compact) !important;
    padding-block: 0.45rem !important;
    font-size: var(--artist-text-sm) !important;
    font-weight: var(--artist-weight-strong) !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    border-radius: var(--artist-control-radius);
}

body.artist-private-body .artist-private-main .artist-portal-setlist-row__menu-button {
    width: var(--artist-control-height-compact) !important;
}

/* Buttons that keep their own shape but share the type scale */
body.artist-private-body .artist-private-main :is(
    .artist-portal-pill-button,
    .artist-portal-media-icon-button,
    .artist-portal-help-trigger
) {
    font-size: var(--artist-text-md) !important;
    font-weight: var(--artist-weight-strong) !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* Pager buttons use the same 42px square as the other portal tables */
body.artist-private-body .artist-private-main .agenda-pagination .agenda-icon {
    width: var(--artist-control-height) !important;
    min-width: var(--artist-control-height) !important;
    padding-inline: 0 !important;
}

/* Form controls: 14px / 42px */
body.artist-private-body :is(.artist-private-main, .modal) :is(
    input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"], [type="submit"], [type="button"], [type="image"]),
    select:not([multiple], [size]),
    .op-select-trigger
):not(:is([data-linkfolio-preview], .artist-qr-preview-paper, .artist-font-picker-sample) *) {
    height: var(--artist-control-height) !important;
    min-height: var(--artist-control-height) !important;
    padding-block: 0 !important;
    font-size: var(--artist-text-base) !important;
    font-weight: var(--artist-weight-regular) !important;
    line-height: 1.3 !important;
}

body.artist-private-body :is(.artist-private-main, .modal) textarea:not(:is([data-linkfolio-preview], .artist-qr-preview-paper, .artist-font-picker-sample) *) {
    font-size: var(--artist-text-base) !important;
    font-weight: var(--artist-weight-regular) !important;
    line-height: 1.45 !important;
}

/* Field labels: 13px / 600 */
body.artist-private-body :is(.artist-private-main, .modal) :is(
    label:not([class]),
    .form-label,
    .op-field > label,
    .atk-field > label,
    .agenda-field > label,
    .merch-field > label,
    .artist-contact-dropdown-field > span,
    .staff-table-dropdown-field > span
):not(:is([data-linkfolio-preview], .artist-qr-preview-paper, .artist-font-picker-sample) *) {
    font-size: var(--artist-text-md) !important;
    font-weight: var(--artist-weight-strong) !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
}

/* Tables: 12px / 600 headers, 13px cells (grid cards keep their own title style) */
body.artist-private-body .artist-private-main table:not(.atk-grid) th {
    font-size: var(--artist-text-sm) !important;
    font-weight: var(--artist-weight-strong) !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

body.artist-private-body .artist-private-main table:not(.atk-grid) th a {
    font-size: inherit !important;
    font-weight: inherit !important;
    letter-spacing: inherit !important;
    text-transform: inherit !important;
}

body.artist-private-body .artist-private-main table:not(.atk-grid) td {
    font-size: var(--artist-text-md) !important;
    font-weight: var(--artist-weight-regular) !important;
}

/* Body copy and helper text */
body.artist-private-body .artist-private-main :is(.card-body, .modal-body, form) > p:not([class]),
body.artist-private-body .artist-private-main p.text-muted:not(.small) {
    font-size: var(--artist-text-base) !important;
    line-height: 1.5 !important;
}

body.artist-private-body :is(.artist-private-main, .modal) :is(.helptext, .form-text, small, .small):not(:is([data-linkfolio-preview], .artist-qr-preview-paper, .artist-font-picker-sample) *) {
    font-size: var(--artist-text-sm) !important;
    line-height: 1.4 !important;
}

/* Section titles inside workspaces and forms (Bootstrap heading helpers) */
body.artist-private-body .artist-private-main :is(h2, h3, h4, h5, h6):is(.h4, .h5, .h6):not(.artist-linkfolio-title) {
    font-size: var(--artist-section-title-size) !important;
    font-weight: var(--artist-weight-strong) !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
}

/* iOS zooms into focused fields below 16px */
@media (max-width: 767.98px) {
    body.artist-private-body :is(.artist-private-main, .modal) :is(
        input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"], [type="submit"], [type="button"], [type="image"]),
        select:not([multiple], [size]),
        textarea,
        .op-select-trigger
    ):not(:is([data-linkfolio-preview], .artist-qr-preview-paper, .artist-font-picker-sample) *) {
        font-size: 16px !important;
    }
}
