:root {
    --primary-color: #285390;
    --primary-color-text: var(--primary-color);
    --primary-color-transparent: #285390cc;
    --primary-color-accent-bg: #28539022;
    --header-bg-color: #9ebce6;
    --logo-color: #ffffff;
    --light-text-color: #303030;
    --light-bg-color: #ffffff;
    --dark-text-color: #f2f2f2;
    --dark-bg-color: #1a1a1a;
    --dark-primary-color-text: #9ebce6;
    --transparency: 0.8;
    --16-9-inline-size: clamp(30rem, 55vw, 53rem);
    --4-3-inline-size: clamp(22.5rem, 41.25vw, 39.75rem);
    --1-1-inline-size: clamp(16.875rem, 30.9375vw, 29.8125rem);

    color-scheme: light;

    @media (prefers-color-scheme: dark) {
        color-scheme: dark;
        --light-text-color: var(--dark-text-color);
        --light-bg-color: var(--dark-bg-color);
        --primary-color-text: var(--dark-primary-color-text);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
}

@font-face {
    font-family: 'News Cycle';
    src: url('../fonts/newscycle-regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    unicode-range: U+0000-007F;
}

@font-face {
    font-family: 'News Cycle';
    src: url('../fonts/newscycle-bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    unicode-range: U+0000-007F;
}

@font-face {
    font-family: 'Libre Franklin';
    src: url('../fonts/librefranklin-regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    unicode-range: U+0000-007F;
}

@font-face {
    font-family: 'Libre Franklin';
    src: url('../fonts/librefranklin-italic.woff2') format('woff2');
    font-weight: normal;
    font-style: italic;
    unicode-range: U+0000-007F;
}

@font-face {
    font-family: 'Libre Franklin';
    src: url('../fonts/librefranklin-bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    unicode-range: U+0000-007F;
}

@font-face {
    font-family: 'Libre Franklin';
    src: url('../fonts/librefranklin-bolditalic.woff2') format('woff2');
    font-weight: bold;
    font-style: italic;
    unicode-range: U+0000-007F;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    unicode-range: U+2192;
}

html {
    scroll-behavior: smooth;
}

html, body {
    block-size: 100dvh;
    inline-size: 100dvw;
}

body {
    font-family: "Libre Franklin", "Open Sans", system-ui, sans-serif;
    color: var(--light-text-color);
    background-color: var(--light-bg-color);
    margin: 0;
    display: flex;
    flex-direction: column;
}

main {
    flex-grow: 1;
}

main > *:not(.section-bg, .full-width), .section-bg > * {
    inline-size: min(90rem, 100% - 4rem);
    margin-inline: auto;
}

footer {
    text-align: center;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 1rem;
    flex-shrink: 0;
}

footer p {
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "News Cycle", "Libre Franklin", "Open Sans", system-ui, sans-serif;
    color: var(--primary-color-text);
    line-height: 1.4;
    text-wrap: balance;
}

h1 {
    font-weight: 400;
    text-align: center;
    margin-block-start: 4rem;
    margin-block-end: 2rem;
}

h3 {
    font-size: 1.3rem;
}

p, ul {
    line-height: 1.8;
    text-wrap: pretty;
    margin-block: 1.5rem;
}

/* Firefox text-wrap fix */
#broken-p {
    max-inline-size: 60ch;
}

a {
    color: var(--primary-color-text);
    text-decoration: none;
}

a:hover {
    color: var(--light-text-color);
    text-decoration: underline;
}

img {
    display: block;
    max-inline-size: 100%;
}

nav {
    background-color: var(--primary-color-transparent);
    color: white;
    text-align: center;
    text-transform: uppercase;
    text-wrap: balance;
}

nav ul {
    display: contents;
    list-style: none;
    margin-block: 0;
    line-height: normal;
    font-size: 0;
}

nav li {
    display: inline-block;
    font-size: 1rem;
    padding-block: 1rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding-block: 1rem;
    padding-inline: 1.25rem;
}

nav a:hover, nav a:focus-visible, #active-nav {
    color: var(--primary-color-text);
    text-decoration: none;
    background-color: var(--light-bg-color);
}

.label {
    color: white;
    font-weight: 700;
    background-color: var(--primary-color);
    inline-size: fit-content;
    padding: 0.2em 0.8ch 0.2em;
}

h2.label, h3.label, h4.label, h5.label, h6.label {
    padding-block-start: 0.1em;
}

.label a {
    color: white;
}

.label a::after {
    display: inline-block;
    content: "\2192";
    font-family: "Inter", system-ui, sans-serif;
    padding-inline-start: 0.5rem;
}

.subheading {
    font-family: "Libre Franklin", "Open Sans", system-ui, sans-serif;
    font-size: 1rem;
    color: var(--light-text-color);
    margin-block-start: -0.9rem;
    margin-block-end: 0.6em;
}

.text-shrink {
    font-size: 0.9em;
    font-weight: 400;
    padding-inline-start: 0.2em;
}

.award {
    background-color: var(--primary-color);
    color: white;
    inline-size: fit-content;
    display: flex;
    overflow: clip;

    p {
        margin: 0;
        line-height: 1.1;
    }
}

.award-badge {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    background-image: url("../img/award.svg");
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 3rem;
    inline-size: 3rem;
    margin-inline-start: 0.75rem;
    padding-block-start: 1.75rem;
    flex-shrink: 0;
    text-align: center;

    span:nth-child(1) {
        font-size: 0.7rem;
        vertical-align: super;
    }

    span:nth-child(2) {
        display: none;
    }
}

.award-text {
    padding: 0.75rem;
    padding-inline-end: 1.125rem;

    span {
        display: block;
    }
}

.award-year {
    font-size: 0.8rem;
}

.award-title {
    font-weight: 600;
}

.award-org {
    font-size: 0.7rem;
}

.award-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
}

.award-top {
    justify-content: center;
}

.summary {
    --summary-item-min-size: 15rem;
    display: grid;
/* Force even number of columns */
    grid-template-columns: repeat(auto-fit, minmax(min(var(--summary-item-min-size), 100%), 1fr) minmax(min(var(--summary-item-min-size), 100%), 1fr));
    gap: 2.5rem;

/* Switch to single column when width less than --summary-item-min-size times 2 plus gap plus 4rem page margins */
    @media (width < 36.5rem) {
        grid-template-columns: 1fr;
    };
}

.summary-item {
    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.2rem;
        margin-block: 0.9rem;
    }

    .label {
        margin-block-start: 1.5rem;
    }

    .subheading {
        font-size: 0.9rem;
    }

    img {
        margin-inline: auto;

        @media (width < 36.5rem) {
            inline-size: var(--4-3-inline-size);
        }
    }
}

.columns {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
}

.columns > * {
    margin-inline: auto;
}

.column-text {
    min-inline-size: min(23rem, 100%);
    flex: 1;
}

.column-img {
    inline-size: var(--4-3-inline-size);
}

.column-img img {
    inline-size: 100%;
}

.column-img-square {
    inline-size: var(--1-1-inline-size);
}

.column-vid iframe {
    aspect-ratio: 16 / 9;
    inline-size: var(--16-9-inline-size);
    max-inline-size: 100%;
    display: block;
}

.column-vid-sd iframe {
    aspect-ratio: 4 / 3;
    inline-size: var(--4-3-inline-size);
    max-inline-size: 100%;
    display: block;
}

#election-social {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: min-content;
    gap: 1rem;
}

.even-sections .section-bg:nth-of-type(even) > section.columns {
    flex-direction: row-reverse;
}

.odd-sections .section-bg:nth-of-type(odd) > section.columns {
    flex-direction: row-reverse;
}

.even-sections .section-bg:nth-of-type(odd) {
    background-color: var(--primary-color-accent-bg);
}

.odd-sections .section-bg:nth-of-type(even) {
    background-color: var(--primary-color-accent-bg);
}

.even-sections .section-bg:nth-of-type(1) {
    margin-block-start: 4rem;
}

.page header {
    background-color: var(--header-bg-color);
    background-image: url("../img/mountains.svg");
    background-repeat: no-repeat;
    background-position: right bottom;
    background-size: auto 95%;
}

.page footer {
    background-color: var(--primary-color);
    color: white;
}

.page section {
    padding: 2rem 0;
    overflow: hidden;
}

.page section h2 {
    margin-block-start: 0;
}

.page #logo {
    display: block;
    margin: auto;
    padding-block: 1rem;
    block-size: 8.5rem;
    max-inline-size: 90%;
    opacity: var(--transparency);
}

/* Shrink header on mobile */
@media (width < 27.375rem)
{
    h1 {
        margin-block-start: 2rem;
        margin-block-end: 0rem;
    }

    .page #logo {
        block-size: 7rem;
    }

    .even-sections .section-bg:nth-of-type(1) {
        margin-block-start: 2rem;
    }
}

.home body {
    background-color: var(--primary-color);
}

.home body::before {
    background-image: url("../img/home-bg.webp");
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    background-attachment: fixed;
    animation: fade-in 2s 0.5s both cubic-bezier(0.11, 0, 0.5, 0);
    content:"";
    position: fixed;
    inset: 0;
    z-index: -1;
}

.home main {
    align-content: center;
}

.home footer {
    color: white;
    text-shadow: 0 0 2rem black;
    padding: 0 0 1rem 0;
    animation: fade-in 1s 2s both cubic-bezier(0.11, 0, 0.5, 0);
}

.home #logo {
    margin: auto auto auto 0;
    max-block-size: 100%;
    min-block-size: 4rem;
    inline-size: min(30rem, 60%);
    opacity: var(--transparency);
    animation: scale-logo 3s both cubic-bezier(0.5, 1, 0.89, 1);
    color-scheme: light;
}

.home #logo-box {
    inline-size: min(60rem, 100% - 4rem);
    block-size: calc(30svh - 1rem);
    margin: auto;
    padding: min(3rem, 7%) 2rem;
    align-content: center;
}

.home #logo-clip {
    position: absolute;
    block-size: 100dvh;
    inline-size: 100dvw;
    overflow: clip;
}

.home nav {
    margin-block-start: calc((30svh - 1rem) + (min(3rem, 7%) * 2));
    animation: fade-in 1s 2s both cubic-bezier(0.11, 0, 0.5, 0);
}

.home-text {
    color: white;
    font-size: clamp(2rem, 7vh + 0.5rem, 7rem);
    line-height: 1;
    max-inline-size: min(57rem, 100%);
    block-size: 100%;
    margin: 1rem auto;
    text-shadow: 0 0 10rem black;
    animation: scale-text 3s 2s both cubic-bezier(0.5, 1, 0.89, 1);

    @media (width < 53rem) {
        font-size: clamp(1.5rem, 4vw + 1rem, 7rem);
    }
}

.home-text span {
    animation: fade-in 0.8s both cubic-bezier(0.11, 0, 0.5, 0);
}

.home-text span:nth-child(1) {
    animation-delay: 2.1s;
}

.home-text span:nth-child(2) {
    animation-delay: 2.2s;
}

.home-text span:nth-child(3) {
    animation-delay: 2.3s;
}

.home-text span:nth-child(4) {
    animation-delay: 2.4s;
}

.home-text span:nth-child(5) {
    animation-delay: 2.5s;
}

.home-text span:nth-child(6) {
    animation-delay: 2.6s;
}

.home-text span:nth-child(7) {
    animation-delay: 2.7s;
}

.home-text span:nth-child(8) {
    animation-delay: 2.8s;
}

.home-text span:nth-child(9) {
    animation-delay: 2.9s;
}

.home-text span:nth-child(10) {
    animation-delay: 3s;
}

.home-text span:nth-child(11) {
    animation-delay: 3.1s;
}

.home-text span:nth-child(12) {
    animation-delay: 3.2s;
}

.home-text span:nth-child(13) {
    animation-delay: 3.3s;
}

.home-text span:nth-child(14) {
    animation-delay: 3.4s;
}

.home-text span:nth-child(15) {
    animation-delay: 3.5s;
}

@keyframes scale-logo {
    from {
        transform: translateX(100vmin) translateY(150vmin) rotateX(75deg) rotateY(-20deg) rotateZ(10deg) scale(20);
    }
}

@keyframes scale-text {
    from {
        transform: scale(0.94);
    }
    to {
        transform: scale(1);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        filter: blur(4px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* Safari animation fixes */
@supports ((hanging-punctuation: first) /*and (font: -apple-system-body)*/ and (-webkit-appearance: none)) {
    nav {
        text-wrap: wrap;
    }
    @keyframes scale-logo {
        from {
            transform: translateX(23svw) translateY(45svh) rotateX(75deg) rotateY(-20deg) rotateZ(10deg) scale(1);
        }
    }
    @keyframes fade-in {
        from {
            opacity: 0;
            filter: blur(0);
        }
    }
}

