/*
 * Design tokens for go-v2/app (prefix --dt-).
 *
 * This is the only file that may contain raw color, font, radius, and shadow values. All other first-party
 * CSS and HTML must use var(--dt-*). The `npm run lint:css` check enforces this.
 *
 * Source: the Dust app (Ionic 8, iOS mode): src/theme/variables.scss and src/global.scss.
 * The app follows the system color scheme, so there is a light set (:root) and a dark set
 * (prefers-color-scheme: dark).
 *
 * Load order: first stylesheet on every page.
 * - jQuery Mobile pages: the document.write in Scripts/gomobileevents.js.
 * - Other pages (calendar, calendarlist, eventinformation, pay, purchase, buy, schedule): a <link> in the page.
 */

/* Dust fonts. The font files are in Styles/fonts/dust/. */
@font-face {
    font-family: "Gelion Regular";
    font-style: normal;
    font-weight: normal;
    font-display: swap;
    src: local("Gelion Regular"), url("fonts/dust/gelion-regular.woff") format("woff");
}

@font-face {
    font-family: "Gelion Medium";
    font-style: normal;
    font-weight: normal;
    font-display: swap;
    src: local("Gelion Medium"), url("fonts/dust/gelion-medium.woff") format("woff");
}

@font-face {
    font-family: "Gelion Semi Bold";
    font-style: normal;
    font-weight: normal;
    font-display: swap;
    src: local("Gelion Semi Bold"), url("fonts/dust/gelion-semibold.woff") format("woff");
}

@font-face {
    font-family: "Gelion Bold";
    font-style: normal;
    font-weight: normal;
    font-display: swap;
    src: local("Gelion Bold"), url("fonts/dust/gelion-bold.woff") format("woff");
}

@font-face {
    font-family: "Grotesk Bold";
    font-style: normal;
    font-weight: normal;
    font-display: swap;
    src: local("Grotesk Bold"), url("fonts/dust/grotesk-bold.woff") format("woff");
}

/* ---------------------------------------------------------------------------------------------------------
 * Light
 * ------------------------------------------------------------------------------------------------------- */
:root {
    color-scheme: light dark;

    /* Brand palette */
    --dt-primary: #f61067;
    --dt-primary-rgb: 246, 16, 103;
    --dt-primary-contrast: #ffffff;
    --dt-primary-shade: #aa134d;
    --dt-primary-tint: #aa134d;

    --dt-secondary: #2196f3;
    --dt-secondary-contrast: #ffffff;
    --dt-secondary-shade: #36abe0;
    --dt-secondary-tint: #50c8ff;

    --dt-tertiary: #19c32a;
    --dt-tertiary-contrast: #ffffff;
    --dt-tertiary-shade: #16ab25;
    --dt-tertiary-tint: #1bd62e;

    --dt-success: #2dd36f;
    --dt-success-contrast: #ffffff;
    --dt-success-shade: #28ba62;
    --dt-success-tint: #42d77d;

    --dt-warning: #ffc409;
    --dt-warning-contrast: #000000;
    --dt-warning-shade: #e0ac08;
    --dt-warning-tint: #ffca22;

    --dt-danger: #eb445a;
    --dt-danger-contrast: #ffffff;
    --dt-danger-shade: #cf3c4f;
    --dt-danger-tint: #ed576b;

    --dt-dark: #222428;
    --dt-dark-contrast: #ffffff;
    --dt-medium: #92949c;
    --dt-medium-contrast: #ffffff;
    --dt-light: #f4f5f8;
    --dt-light-contrast: #000000;
    --dt-bright: #8a8b94;

    /* Surfaces and text (Ionic iOS light defaults) */
    --dt-background: #ffffff;
    --dt-background-rgb: 255, 255, 255;
    --dt-text: #000000;
    --dt-text-rgb: 0, 0, 0;
    --dt-text-muted: var(--dt-step-600); /* card text, tab button text */
    --dt-link: var(--dt-primary);

    /* Neutral steps: text color mixed into the background (Ionic --ion-color-step-N) */
    --dt-step-50: #f2f2f2;
    --dt-step-100: #e6e6e6;
    --dt-step-150: #d9d9d9;
    --dt-step-200: #cccccc;
    --dt-step-250: #bfbfbf;
    --dt-step-300: #b3b3b3;
    --dt-step-400: #999999;
    --dt-step-500: #808080;
    --dt-step-600: #666666;
    --dt-step-700: #4d4d4d;
    --dt-step-800: #333333;
    --dt-step-900: #1a1a1a;

    --dt-toolbar-background: #f7f7f7;
    --dt-toolbar-border: rgba(0, 0, 0, 0.2);
    --dt-tab-bar-background: #f7f7f7;
    --dt-item-background: #ffffff;
    --dt-item-border: #c8c7cc;
    --dt-card-background: #ffffff;
    --dt-input-background: rgba(var(--dt-text-rgb), 0.07); /* ion-searchbar (iOS) */
    --dt-segment-background: rgba(var(--dt-text-rgb), 0.065); /* ion-segment (iOS) */
    --dt-segment-active-background: #ffffff;
    --dt-backdrop: rgba(0, 0, 0, 0.4);

    /* Text on a photo or a dark scrim (purchase page, image viewers). Same in light and dark. */
    --dt-on-media: #ffffff;
    --dt-on-media-rgb: 255, 255, 255;
    --dt-on-media-muted: rgba(var(--dt-on-media-rgb), 0.7);
    --dt-on-media-border: rgba(var(--dt-on-media-rgb), 0.4);
    --dt-scrim: rgba(0, 0, 0, 0.6);
    --dt-media-background: #000000;

    /* Typography */
    --dt-font-regular: "Gelion Regular", -apple-system, "Helvetica Neue", Roboto, sans-serif;
    --dt-font-medium: "Gelion Medium", -apple-system, "Helvetica Neue", Roboto, sans-serif;
    --dt-font-semibold: "Gelion Semi Bold", -apple-system, "Helvetica Neue", Roboto, sans-serif;
    --dt-font-bold: "Gelion Bold", -apple-system, "Helvetica Neue", Roboto, sans-serif;
    --dt-font-title: "Grotesk Bold", -apple-system, "Helvetica Neue", Roboto, sans-serif;
    --dt-font-mono: ui-monospace, Menlo, Consolas, monospace;

    --dt-font-size-xs: 12px;
    --dt-font-size-sm: 14px;
    --dt-font-size-md: 16px;
    --dt-font-size-lg: 20px;
    --dt-font-size-xl: 24px;
    --dt-font-size-h1: 2rem;
    --dt-font-size-h2: 1.5rem;
    --dt-font-size-item: 1.2rem;
    --dt-font-size-card-title: 20px;
    --dt-font-size-title: 17px; /* ion-title (iOS) */
    --dt-font-size-button: 17px; /* ion-button (iOS) */
    --dt-line-height-text: 1.5;

    /* Spacing (4px scale) */
    --dt-space-1: 4px;
    --dt-space-2: 8px;
    --dt-space-3: 12px;
    --dt-space-4: 16px;
    --dt-space-5: 24px;
    --dt-space-6: 32px;

    /* Shape and depth */
    --dt-radius-card: 8px;
    --dt-radius-button: 14px;
    --dt-radius-button-small: 6px;
    --dt-radius-segment: 8px;
    --dt-radius-input: 10px;
    --dt-radius-badge: 10px;
    --dt-radius-popup: 14px;
    --dt-radius-scrollbar: 10px;
    --dt-radius-round: 9999px;
    --dt-shadow-card: 0 4px 16px rgba(0, 0, 0, 0.12);
    --dt-shadow-segment: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
    --dt-shadow-popup: 0 8px 32px rgba(0, 0, 0, 0.24);
    --dt-shadow-text: 0 1px 2px rgba(0, 0, 0, 0.5);
    --dt-toolbar-min-height: 44px;
    --dt-item-min-height: 44px;
    --dt-item-padding-start: 16px;

    /* Safe-area padding for the fixed header and footer (jQuery Mobile pages) */
    --dt-header-pad: max(35px, env(safe-area-inset-top));
    --dt-footer-pad: env(safe-area-inset-bottom);
    --dt-card-margin: 24px 16px;
}

/* ---------------------------------------------------------------------------------------------------------
 * Dark (Dust "@media (prefers-color-scheme: dark)" + ".ios body")
 * ------------------------------------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
    :root {
        --dt-secondary: #50c8ff;
        --dt-secondary-shade: #46b0e0;
        --dt-secondary-tint: #62ceff;

        --dt-success: #2fdf75;
        --dt-success-contrast: #000000;
        --dt-success-shade: #29c467;
        --dt-success-tint: #44e283;

        --dt-warning: #ffd534;
        --dt-warning-shade: #e0bb2e;
        --dt-warning-tint: #ffd948;

        --dt-danger: #ff4961;
        --dt-danger-shade: #e04055;
        --dt-danger-tint: #ff5b71;

        --dt-dark: #f4f5f8;
        --dt-dark-contrast: #000000;
        --dt-medium: #989aa2;
        --dt-medium-contrast: #000000;
        --dt-light: #222428;
        --dt-light-contrast: #ffffff;
        --dt-bright: #5f5f65;

        --dt-background: #000000;
        --dt-background-rgb: 0, 0, 0;
        --dt-text: #ffffff;
        --dt-text-rgb: 255, 255, 255;

        --dt-step-50: #0d0d0d;
        --dt-step-100: #1a1a1a;
        --dt-step-150: #262626;
        --dt-step-200: #333333;
        --dt-step-250: #404040;
        --dt-step-300: #4d4d4d;
        --dt-step-400: #666666;
        --dt-step-500: #808080;
        --dt-step-600: #999999;
        --dt-step-700: #b3b3b3;
        --dt-step-800: #cccccc;
        --dt-step-900: #e6e6e6;

        --dt-toolbar-background: #0d0d0d;
        --dt-toolbar-border: #262626;
        --dt-tab-bar-background: #0d0d0d;
        --dt-item-background: #000000;
        --dt-item-border: #404040;
        --dt-card-background: #1c1c1d;
        --dt-segment-active-background: #636366;
        --dt-backdrop: rgba(0, 0, 0, 0.6);
        --dt-shadow-card: 0 4px 16px rgba(0, 0, 0, 0.5);
    }
}
