
/*
 * Joshua Cole for State Senate
 * Christmas Palette
 *
 * Activation:
 *   <html data-palette="christmas">
 *
 * Design hierarchy:
 *
 * - Ivory for the existing light page surfaces
 * - Christmas red for contrasting sections
 * - Christmas green for accent sections
 * - Light green for supporting text on red
 * - Light red for supporting text on green
 * - White for prominent text on both colors
 * - Charcoal for text on ivory surfaces only
 *
 * All reusable colors and semantic roles are
 * centralized in this stylesheet.
 *
 * The other palettes are unaffected.
 */


/*
 * Palette foundations
 */

:root {
    --palette-christmas-red: #a51b2c;
    --palette-christmas-green: #075d35;

    --palette-christmas-light-green: #def7df;
    --palette-christmas-light-red: #ffe0e5;

    --palette-christmas-ivory: #faf9f4;
    --palette-christmas-white: var(--color-white);

    --palette-christmas-ink: #202020;

    --palette-christmas-red-hover:
        color-mix(
            in srgb,
            var(--palette-christmas-red) 90%,
            var(--palette-christmas-light-green) 10%
        );

    --palette-christmas-green-hover:
        color-mix(
            in srgb,
            var(--palette-christmas-green) 90%,
            var(--palette-christmas-light-red) 10%
        );

    --palette-christmas-photo-scrim: #410d18;
}


/*
 * Semantic color roles
 */

:root[data-palette="christmas"] {

    /*
     * Surfaces
     *
     * The light-background structure stays intact.
     *
     * Existing black contrast sections become red.
     * Existing green accent sections remain green.
     */

    --color-surface-primary:
        var(--palette-christmas-ivory);

    --color-surface-secondary:
        var(--palette-christmas-ivory);

    --color-surface-contrast:
        var(--palette-christmas-red);

    --color-surface-contrast-hover:
        var(--palette-christmas-red-hover);

    --color-surface-accent:
        var(--palette-christmas-green);

    --color-surface-accent-hover:
        var(--palette-christmas-green-hover);

    --color-surface-highlight:
        var(--palette-christmas-light-green);


    /*
     * Text
     */

    --color-text-primary:
        var(--palette-christmas-ink);

    --color-text-secondary:
        color-mix(
            in srgb,
            var(--palette-christmas-ink) 85%,
            var(--palette-christmas-ivory) 15%
        );

    --color-text-on-contrast:
        var(--palette-christmas-white);

    --color-text-on-accent:
        var(--palette-christmas-white);

    --color-text-on-secondary:
        var(--palette-christmas-ink);


    /*
     * Borders
     */

    --color-border:
        color-mix(
            in srgb,
            var(--palette-christmas-ink) 30%,
            transparent
        );

    --color-border-on-contrast:
        color-mix(
            in srgb,
            var(--palette-christmas-light-green) 55%,
            transparent
        );


    /*
     * Action colors
     *
     * Red is the primary action background.
     * White provides readable button lettering.
     */

    --color-action:
        var(--palette-christmas-red);

    --color-action-hover:
        var(--palette-christmas-red-hover);

    --color-action-bright:
        var(--palette-christmas-light-green);

    --color-action-text:
        var(--palette-christmas-white);


    /*
     * Links
     *
     * Red on ivory.
     * Light green on red.
     */

    --color-link:
        var(--palette-christmas-red);

    --color-link-on-contrast:
        var(--palette-christmas-light-green);


    /*
     * Navigation Donate button
     */

    --color-button-primary-bg:
        var(--palette-christmas-red);

    --color-button-primary-text:
        var(--palette-christmas-white);

    --color-button-primary-bg-hover:
        var(--palette-christmas-green);


    /*
     * General solid buttons
     *
     * Red by default.
     * Light green with red lettering on hover.
     */

    --color-button-solid-bg:
        var(--palette-christmas-red);

    --color-button-solid-text:
        var(--palette-christmas-white);

    --color-button-solid-hover-bg:
        var(--palette-christmas-light-green);

    --color-button-solid-hover-text:
        var(--palette-christmas-red);


    /*
     * Focus indicators
     */

    --color-focus-ring:
        var(--palette-christmas-red);

    --color-focus-ring-on-contrast:
        var(--palette-christmas-light-green);


    /*
     * Interactive elements on red sections
     */

    --color-action-on-contrast:
        var(--palette-christmas-light-green);

    --color-button-on-contrast-hover-bg:
        var(--palette-christmas-green);

    --color-button-on-contrast-hover-text:
        var(--palette-christmas-light-red);


    /*
     * Donation and action headings
     */

    --color-text-on-action-emphasis:
        var(--palette-christmas-white);


    /*
     * Media
     */

    --color-media-placeholder:
        var(--palette-christmas-green);

    --color-media-overlay:
        var(--palette-christmas-photo-scrim);

    --color-photo-text:
        var(--palette-christmas-white);

    --color-photo-scrim:
        var(--palette-christmas-photo-scrim);

    --color-modal-backdrop:
        color-mix(
            in srgb,
            var(--palette-christmas-red) 90%,
            transparent
        );


    /*
     * Compatibility aliases
     */

    --color-background:
        var(--color-surface-primary);

    --color-paper:
        var(--color-surface-primary);

    --color-surface:
        var(--color-surface-primary);

    --color-text:
        var(--color-text-primary);

    --color-muted:
        var(--color-text-secondary);
}


/*
 * Header and footer logos
 *
 * Black artwork on the ivory header.
 * White artwork on the red footer.
 *
 * The original SVG remains unchanged.
 */

:root[data-palette="christmas"]
.site-brand__logo {
    filter: brightness(0);
}

:root[data-palette="christmas"]
.site-footer__logo {
    filter: brightness(0) invert(1);
}


/*
 * Navigation
 *
 * The underline is red on ivory.
 */

:root[data-palette="christmas"]
.site-nav__link:not(.site-nav__link--donate)::after {
    background: var(--palette-christmas-red);
}


/*
 * Meet Joshua
 *
 * Red hero with a light-green eyebrow.
 * Main heading remains white.
 */

:root[data-palette="christmas"]
.page-meet .meet-hero__panel {
    background: var(--color-surface-contrast);
    color: var(--color-text-on-contrast);
}

:root[data-palette="christmas"]
.page-meet .meet-hero__eyebrow {
    color: var(--palette-christmas-light-green);
}


/*
 * Red sections
 *
 * White headings and light-green supporting text.
 */

:root[data-palette="christmas"]
.home-record__eyebrow,

:root[data-palette="christmas"]
.section-heading--dark .section-heading__eyebrow,

:root[data-palette="christmas"]
.interior-section--dark .interior-eyebrow,

:root[data-palette="christmas"]
.interior-section--dark .interior-list__number,

:root[data-palette="christmas"]
.interior-section--dark
.interior-panel:not(.interior-panel--featured)
.interior-panel__number,

:root[data-palette="christmas"]
.page-why-running .why-running__eyebrow {
    color: var(--palette-christmas-light-green);
}

:root[data-palette="christmas"]
.home-record__body,

:root[data-palette="christmas"]
.section-heading--dark .section-heading__body,

:root[data-palette="christmas"]
.interior-section--dark .interior-copy {
    color: var(--palette-christmas-light-green);
}


/*
 * Green accent sections
 *
 * White headings with light-red supporting text.
 */

:root[data-palette="christmas"]
.record-card--featured .record-card__body,

:root[data-palette="christmas"]
.interior-panel--featured .interior-panel__body,

:root[data-palette="christmas"]
.home-support__body,

:root[data-palette="christmas"]
.signup-band__body,

:root[data-palette="christmas"]
.page-meet .meet-ending .meet-article__copy {
    color: var(--palette-christmas-light-red);
}

:root[data-palette="christmas"]
.home-support__eyebrow,

:root[data-palette="christmas"]
.signup-band__eyebrow,

:root[data-palette="christmas"]
.page-meet .meet-ending .interior-eyebrow {
    color: var(--palette-christmas-light-red);
}


/*
 * Featured cards on green
 */

:root[data-palette="christmas"]
.record-card--featured .record-card__number,

:root[data-palette="christmas"]
.interior-panel--featured .interior-panel__number {
    color: var(--palette-christmas-light-red);
}


/*
 * Homepage donation section
 *
 * Red donation panel directly beside green
 * volunteer panel.
 *
 * Keep the donation heading white.
 */

:root[data-palette="christmas"]
.home-support .donation-band__eyebrow {
    color: var(--palette-christmas-light-green);
}

:root[data-palette="christmas"]
.home-support .donation-band__body {
    color: var(--palette-christmas-light-green);
}

:root[data-palette="christmas"]
.home-support .donation-band__heading {
    color: var(--palette-christmas-white);
}


/*
 * General donation-band content
 *
 * For red surfaces outside the homepage as well.
 */

:root[data-palette="christmas"]
.donation-band__eyebrow,

:root[data-palette="christmas"]
.donation-band__body {
    color: var(--palette-christmas-light-green);
}


/*
 * Homepage volunteer action
 *
 * Red button on green.
 */

:root[data-palette="christmas"]
.home-support__cta {
    background: var(--palette-christmas-red);
    color: var(--palette-christmas-white);
}

:root[data-palette="christmas"]
.home-support__cta:hover,

:root[data-palette="christmas"]
.home-support__cta:focus-visible {
    background: var(--palette-christmas-red-hover);
    color: var(--palette-christmas-white);
}


/*
 * Homepage signup section
 *
 * The homepage uses a red contrasting surface.
 * Other signup bands may use green.
 */

:root[data-palette="christmas"]
.page-home .signup-band__eyebrow,

:root[data-palette="christmas"]
.page-home .signup-band__body {
    color: var(--palette-christmas-light-green);
}


/*
 * Endorsements
 *
 * Organization section: red.
 * State/national section: green.
 *
 * Photograph captions retain white text over
 * their photographic scrims.
 */

:root[data-palette="christmas"]
.endorsements-section--organizations
.endorsements-section__description,

:root[data-palette="christmas"]
.endorsements-section--organizations
.endorsement-name__detail {
    color: var(--palette-christmas-light-green);
}

:root[data-palette="christmas"]
.endorsements-section--state-national {
    color: var(--palette-christmas-white);
}

:root[data-palette="christmas"]
.endorsements-section--state-national
.endorsements-section__description,

:root[data-palette="christmas"]
.endorsements-section--state-national
.endorsement-name__detail,

:root[data-palette="christmas"]
.endorsements-section--state-national
.endorsement-photo--logo .endorsement-photo__detail {
    color: var(--palette-christmas-light-red);
}


/*
 * Footer
 *
 * Red replaces black.
 * White text and logo remain.
 * Light green provides accent color.
 */

:root[data-palette="christmas"]
.site-footer__official p {
    color: var(--palette-christmas-light-green);
}

:root[data-palette="christmas"]
.site-footer__links a:hover,

:root[data-palette="christmas"]
.site-footer__links a:focus-visible,

:root[data-palette="christmas"]
.site-footer__official a:hover,

:root[data-palette="christmas"]
.site-footer__official a:focus-visible {
    color: var(--palette-christmas-light-green);
}


/*
 * News and informational cards
 *
 * Light-green cards retain charcoal text.
 * Red links remain readable on light green.
 */

:root[data-palette="christmas"]
.news-card,

:root[data-palette="christmas"]
.page-events .events-empty {
    color: var(--palette-christmas-ink);
}

:root[data-palette="christmas"]
.news-card__date,

:root[data-palette="christmas"]
.news-card__excerpt,

:root[data-palette="christmas"]
.page-events .events-empty__heading,

:root[data-palette="christmas"]
.page-events .events-empty p {
    color: var(--palette-christmas-ink);
}


/*
 * Keyboard focus on colored sections
 */

:root[data-palette="christmas"]
.site-footer a:focus-visible,

:root[data-palette="christmas"]
.home-record a:focus-visible,

:root[data-palette="christmas"]
.page-meet .meet-hero a:focus-visible {
    outline-color: var(--palette-christmas-light-green);
}

:root[data-palette="christmas"]
.home-support__volunteer a:focus-visible,

:root[data-palette="christmas"]
.page-meet .meet-ending a:focus-visible {
    outline-color: var(--palette-christmas-light-red);
}
