@font-face {
    font-family: 'Jedira';
    src: url("/static/fonts/Jedira-Regular.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Jedira';
    src: url("/staticfonts/Jedira-Italic.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
    font-style: italic;
}

:root {
    --color-dark: #4A4D69;
    --color-light: #ffffff;
    --color-teal: #48B7B1;
    --color-salmon: #FF8576;
    --color-yellow: #FFD962;
    --color-light-yellow: #ffec9b;
    --color-primary: #C9055E;
    --space-xs: clamp(0.4375rem, 0.42rem + 0.10vw, 0.5rem);
    --space-s: clamp(0.875rem, 0.83rem + 0.20vw, 1rem);
    --space-m: clamp(1.3125rem, 1.25rem + 0.29vw, 1.5rem);
    --space-l: clamp(2.1875rem, 2.09rem + 0.49vw, 2.5rem);
    --space-xl: clamp(3.0625rem, 2.92rem + 0.69vw, 3.5rem);
    --space-2xl: clamp(3.5rem, 3.34rem + 0.78vw, 4rem);
    --space-m-l: clamp(1.3125rem, 0.93rem + 1.86vw, 2.5rem);
    --size-step--2: clamp(0.8125rem, 0.7723rem + 0.0682vw, 0.875rem);
    --size-step--1: clamp(0.9375rem, 0.9119rem + 0.1136vw, 1rem);
    --size-step-0: clamp(1.125rem, 1.0739rem + 0.2273vw, 1.25rem);
    --size-step-1: clamp(1.35rem, 1.2631rem + 0.3864vw, 1.5625rem);
    --size-step-2: clamp(1.62rem, 1.4837rem + 0.6057vw, 1.9531rem);
    --size-step-3: clamp(1.944rem, 1.7405rem + 0.9044vw, 2.4414rem);
    --leading-flat: 1;
    --leading-fine: 1.2;
    --leading-standard: 1.4;
    --leading-loose: 1.7;
    --font-base: "Asap", Roboto, Helvetica Neue, Arial, sans-serif;
    --font-serif: 'Jedira', "Asap", Roboto, Helvetica Neue, Arial, sans-serif;
    --font-regular: 400;
    --font-medium: 600;
    --font-bold: 700;
    --gutter: var(--space-m-l);
    --transition-base: 250ms ease;
    --transition-movement: 200ms linear;
    --transition-fade: 300ms ease;
    --stroke-width: 2px;
    --stroke: var(--stroke-width) solid var(--color-teal);
    --uppercase-kerning: 0.05ch;
    --uppercase-kerning-wide: 0.375ch;
    --transition-base: 250ms ease;
}

/* Box sizing rules */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Prevent font size inflation */
html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
body, h1, h2, p {
    margin-block: 0;
}

body {
    background: var(--color-light);
    color: var(--color-dark);
    font-size: var(--size-step-1);
    font-family: var(--font-base);
    line-height: var(--leading-standard);
    font-size-adjust: from-font;
    margin: 0;
    min-height: 100vh;
    text-align: center;
}

.flow > * + * {
    margin-block-start: var(--flow-space, 1em);
}

.flow-space-xs {
    --flow-space: var(--space-xs);
}

.flow-space-s {
    --flow-space: var(--space-s);
}

.flow-space-m {
    --flow-space: var(--space-m);
}

.flow-space-l {
    --flow-space: var(--space-l);
}

.region {
    padding-block: var(--space-m);
    position: relative;
}

.wrapper {
    margin-inline: auto;
    max-width: var(--wrapper-max-width, 1280px);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    position: relative;
}

.wrapper--narrow {
    margin-inline: auto;
    max-width: var(--wrapper-max-width, 980px);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    position: relative;
}

:is(h1, h2, h3) {
    letter-spacing: var(--uppercase-kerning);
    line-height: var(--leading-fine);
    text-wrap: balance;
    color: var(--color-primary);
    font-weight: var(--font-regular);
}

h1 {
    font-size: var(--size-step-3);
    font-family: var(--font-serif);
}

@media (max-width: 768px) {
    h1 {
        font-size: var(--size-step-2);
    }
}

h2 {
    font-size: var(--size-step-1);
    font-weight: var(--font-medium);
}

h3 {
    font-size: var(--size-step-1);
    font-weight: var(--font-medium);
    color: var(--color-light-yellow);
    margin-top: 0;
}

a:not([class]) {
    text-decoration-skip-ink: auto;
    color: var(--color-primary);
    text-decoration: none;
}

a:not([class]):hover {
    text-decoration: underline;
    text-underline-offset: 0.2lh;
}

svg:not([class]) {
    width: auto;
    height: 1lh;
}

svg {
    flex-shrink: 0;
}

svg[role='img'][width][height] {
    width: revert;
    height: revert;
    background: var(--color-light);
    padding: var(--space-xs);
}

/* Form */
form > * + * {
    margin-top: var(--flow-space, 1rem);
}

:is(input, select, textarea, button, .button) {
    accent-color: var(--color-primary);
    font-family: var(--font-base);
}

:is(input:not([type='checkbox'], [type='radio'], [type='color']), select, textarea) {
    padding: 0.75em var(--space-s);
    border: var(--stroke);
    border-color: var(--color-yellow);
    background: var(--color-light);
    color: var(--color-dark);
    text-align: center;
    font-size: var(--size-step--1);
    letter-spacing: var(--uppercase-kerning);
    width: 100%;

    &::placeholder {
        color: var(--color-dark);
        opacity: 1;
    }
}

:is(button, .button) {
    padding: 0.75em var(--space-s);
    border: var(--stroke);
    border-color: var(--color-yellow);
    background: var(--color-yellow);
    color: var(--color-dark);
    text-align: center;
    font-size: var(--size-step--1);
    text-transform: uppercase;
    letter-spacing: var(--uppercase-kerning-wide);
    font-weight: var(--font-bold);
    width: auto !important;
    transition: var(--transition-base);

    &.is-sm {
        padding: 0.25em var(--space-xs);
        font-size: var(--size-step--2);
        border-radius: 0.5rem;
    }
}

a.button {
    display: inline-block;
    text-decoration: none;

    &:hover {
        text-decoration: underline;
    }
}

:is(button, .button):hover {
    border-color: var(--color-light-yellow);
    background: var(--color-light-yellow);
    color: var(--color-primary);
    outline: 2px solid var(--color-salmon);
    outline-offset: 0.2lh;
}

:focus {
    outline: none;
    transition: var(--transition-base);
}

:focus-visible {
    outline: 2px solid var(--color-salmon);
    outline-offset: 0.2lh;
}

.visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

img {
    height: auto;
    max-width: 100%;
    display: block;
}

/* Custom Images */
.site-head__banner {
    background-image: url('/static/img/img-stripe-banner.svg');
    background-repeat: repeat-x;
    background-position: bottom;
    height: 100px;
}

.site-head__brand {
    display: grid;
    margin: var(--space-l) auto;

    img {
        width: 100%;
        height: auto;
        max-height: var(--space-2xl);
    }
}

.site-hero {
    img {
        border: var(--stroke);
        border-color: var(--color-yellow);
        padding: var(--space-s);
    }
}

/* Title */
.site-head__title {
    border-top: var(--stroke);
    border-bottom: var(--stroke);
    padding: var(--space-s) 0;
    margin-bottom: var(--space-l);
}

footer {
    background-color: var(--color-salmon);
    color: var(--color-light);
    letter-spacing: var(--uppercase-kerning);
}

footer a:not([class]) {
    color: var(--color-light);
}

.small {
    font-size: var(--size-step--1);
}

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

hr {
    border: none;
    border-block-start: var(--stroke);
    margin-block: var(--space-xl) var(--space-m);
    max-width: 16ch;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInAndScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Contact Form */
.contact-form {
    animation: fadeIn 500ms ease-in;
}

.contact-form.form-success {
    animation: fadeInAndScale 500ms ease-in;
}

/* Sign up Form */
.form-signup {
    padding: var(--space-xl);
    animation: fadeIn 500ms ease-in;
}

/* Note: the extra class and animation name are only here ot force
 * the browser to see the change, which triggers the animations. The
 * animations could be the same, but the names of the animations
 * need to be different for the browser to re-trigger them.
 */
.form-signup.form-success {
    animation: fadeInAndScale 500ms ease-in;
}

.form-signup p {
    color: var(--color-light);
}

.form-inline {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-m);
}

.form-inline input[type="text"],
.form-inline input[type="email"] {
    vertical-align: middle;
    border-color: var(--color-light);
    width: calc(44% - 10px); /* Width calculation with spacing */
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    font-size: var(--size-step--1);
    margin-top: var(--space-s);
    color: var(--color-light);
    text-align: left;

    input[type="checkbox"] {
        margin-right: var(--space-xs);
        width: auto;
        accent-color: var(--color-light-yellow);
    }
}

@media (max-width: 900px) {
    .form-signup {
        padding: var(--space-l);
    }

    .form-inline {
        flex-direction: column; /* Stack elements vertically */
        align-items: stretch;
    }

    .form-inline input[type="text"],
    .form-inline input[type="email"] {
        width: 100%; /* Full width for each element */
        margin: var(--space-xs) 0; /* Space between elements */
    }
}

.form-error {
    color: var(--color-light);
    background-color: var(--color-primary);
    padding: var(--space-xs);
    border-radius: 9999px;
    font-size: var(--size-step--1);
    margin-block: var(--space-xs);
    animation: fadeIn 300ms ease-in;

    .form-signup & {
        margin-block-start: var(--space-m);
        margin-block-end: 0;
        color: var(--color-primary);
        background-color: var(--color-light-yellow);
    }
}

.form-hint {
    font-size: var(--size-step--2);
    color: var(--color-dark);
    margin-block-start: var(--space-xs);
    text-align: left;
}

/* Top Flash Banner
 * Needs to float above all content and be dismissible
 */
.flash-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--color-salmon);
    color: var(--color-light);
    padding: var(--space-s);
    text-align: center;
    font-weight: var(--font-bold);
    font-size: var(--size-step-0);
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;

    /* Animation */
    transition: transform var(--transition-movement);
    transform: translateY(-100%);

    &.is-active {
        transform: translateY(0);
    }

    &.is-success {
        background: var(--color-teal);
    }
}

.flash-banner.active {
    transform: translateY(0);
}

.hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.cluster {
    display: flex;
    gap: var(--space-m);
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.repel {
    display: flex;
    gap: var(--space-m);
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-l);
    flex-wrap: wrap;
    gap: var(--space-m);
}

.pagination__info {
    font-size: var(--size-step--1);
    color: var(--color-dark);
}

.pagination__controls {
    display: flex;
    align-items: center;
    gap: var(--space-m);
}

.pagination__link {
    padding: 0.5em var(--space-s);
    border: var(--stroke);
    border-color: var(--color-yellow);
    background: var(--color-yellow);
    color: var(--color-dark);
    text-align: center;
    font-size: var(--size-step--1);
    text-transform: uppercase;
    letter-spacing: var(--uppercase-kerning-wide);
    font-weight: var(--font-bold);
    transition: var(--transition-base);
    text-decoration: none;
}

/* Admin Navigation Tabs */
.admin-nav {
    display: flex;
    justify-content: center;
    gap: var(--space-l);
    margin-block: var(--space-l);
    /* Optional: add a bottom border to the whole container if you want a line across */
    border-bottom: var(--stroke-width) solid var(--color-teal);
}

.admin-nav__link {
    font-family: var(--font-base), sans-serif;
    font-weight: var(--font-bold);
    font-size: var(--size-step-0);
    color: var(--color-dark);
    text-decoration: none;
    padding-bottom: var(--space-xs);
    border-bottom: var(--stroke);
    border-color: transparent;
    transition: var(--transition-base);
    margin-bottom: -2px;
}

.admin-nav__link:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    text-decoration: none;
}

.admin-nav__link.is-active {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.table-wrapper {
    inline-size: 100%;
    max-inline-size: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    inline-size: 100%;
    border-collapse: collapse;
    margin-block-end: var(--space-l);
}

table thead {
    background-color: var(--color-primary);
    color: var(--color-light);
}

table th,
table td {
    border: var(--stroke);
    border-color: color-mix(in srgb, var(--color-primary) 20%, var(--color-light) 80%);
    padding: var(--space-s);
    text-align: start;
    font-size: var(--size-step--1);
}

table th {
    border-color: var(--color-primary);
}

/* Columns that should wrap */
table td[data-wrap],
table th[data-wrap] {
    word-break: break-all;
    overflow-wrap: anywhere;
    white-space: normal;
    min-inline-size: 12ch;
    max-inline-size: 40ch;
}

/* Columns that should NOT wrap */
table td[data-nowrap],
table th[data-nowrap] {
    white-space: nowrap;
}

table td.message > div {
    font-style: italic;
    color: var(--color-dark);
    border-inline-start: 4px solid color-mix(in srgb, var(--color-primary) 40%, var(--color-light) 60%);
    padding-inline-start: var(--space-s);
    text-align: start;
    white-space: pre-wrap;
    word-break: break-word;
}
