/*
 * Caecilia Leden App: the house style on top of UIkit 3.25.26.
 *
 * Colours and fonts follow the theme of the website (yootheme_caecilia). The
 * status colours of the website do not reach 4.5:1 on the background, so the
 * app uses darker tints of the same hues for text and labels (WCAG 2.1 AA).
 */

/* --- Fonts: the same WOFF2 files as the theme of the website ------------- */

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/roboto-400-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/roboto-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/roboto-500-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/roboto-500-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/roboto-700-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/roboto-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Spectral';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/spectral-400-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Spectral';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/spectral-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Spectral';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/spectral-500-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Spectral';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/spectral-500-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Colours and sizes --------------------------------------------------- */

:root {
    --app-blue: #122041;
    --app-blue-dark: #0e1830;
    --app-on-blue: #f3f1ec;
    --app-background: #f7f4ef;
    --app-surface: #fff;
    --app-text: #3b4557;
    --app-link: #3d607e;
    --app-border: #e3dcd1;
    --app-muted: #646f7f;
    --app-danger: #d7212b;
    --app-success: #277d49;
    --app-warning: #b05400;
    --app-header-height: 56px;
    --app-tabbar-height: 60px;
    --app-gutter: 16px;
}

/* --- Base ---------------------------------------------------------------- */

html {
    font-family: Roboto, Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--app-text);
    background: var(--app-background);
}

h1, h2, h3, h4, h5, h6,
.uk-h1, .uk-h2, .uk-h3, .uk-h4, .uk-h5, .uk-h6 {
    font-family: Spectral, Georgia, serif;
    font-weight: 400;
    color: var(--app-blue);
}

h1, .uk-h1 {
    font-size: 2rem;
    line-height: 1.2;
}

a, .uk-link {
    color: var(--app-link);
}

a:hover, .uk-link:hover {
    color: var(--app-blue);
}

:focus-visible {
    outline: 2px solid var(--app-link);
    outline-offset: 2px;
}

.uk-text-muted {
    color: var(--app-muted) !important;
}

.uk-text-danger {
    color: var(--app-danger) !important;
}

.uk-text-success {
    color: var(--app-success) !important;
}

.uk-text-warning {
    color: var(--app-warning) !important;
}

/* --- UIkit components in the house style --------------------------------- */

.uk-button {
    min-height: 44px;
}

.uk-button-primary {
    background-color: var(--app-blue);
    color: var(--app-on-blue);
    border: 1px solid transparent;
}

.uk-button-primary:hover,
.uk-button-primary:focus {
    background-color: transparent;
    color: var(--app-blue);
    border-color: var(--app-blue);
}

.uk-button-default {
    background-color: var(--app-surface);
    color: var(--app-text);
    border: 1px solid var(--app-border);
}

.uk-card-default {
    background-color: var(--app-surface);
    color: var(--app-text);
    border: 1px solid var(--app-border);
    box-shadow: none;
}

.uk-card-default .uk-card-title {
    color: var(--app-blue);
}

.uk-label {
    background: var(--app-blue);
    color: var(--app-on-blue);
    font-family: Spectral, Georgia, serif;
    letter-spacing: .1em;
}

/* --- Layout: header, view and tab bar ------------------------------------ */

body {
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
    padding-top: calc(var(--app-header-height) + env(safe-area-inset-top));
    padding-bottom: calc(var(--app-tabbar-height) + env(safe-area-inset-bottom));
}

.app-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 980;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    height: calc(var(--app-header-height) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(var(--app-gutter), env(safe-area-inset-right)) 0 max(var(--app-gutter), env(safe-area-inset-left));
    background: var(--app-blue);
    color: var(--app-on-blue);
}

.app-brand,
.app-brand:hover {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--app-on-blue);
    font-family: Spectral, Georgia, serif;
    font-size: 1.2rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    text-decoration: none;
}

.app-brand img {
    height: 36px;
    width: auto;
}

.app-offline {
    padding: 2px 10px;
    border: 1px solid var(--app-on-blue);
    border-radius: 500px;
    font-size: .8rem;
}

.app-main {
    box-sizing: border-box;
    max-width: 720px;
    margin: 0 auto;
    padding: 24px max(var(--app-gutter), env(safe-area-inset-right)) 32px max(var(--app-gutter), env(safe-area-inset-left));
    outline: none;
}

.app-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 980;
    display: flex;
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--app-surface);
    border-top: 1px solid var(--app-border);
}

.app-tabbar a {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--app-tabbar-height);
    color: var(--app-muted);
    font-size: .75rem;
    text-decoration: none;
}

.app-tabbar a:hover {
    color: var(--app-blue);
}

.app-tabbar a[aria-current="page"] {
    color: var(--app-blue);
    font-weight: 500;
    box-shadow: inset 0 3px 0 var(--app-blue);
}

/* --- Splash screen --------------------------------------------------------- */

/*
 * The large logo at the first start of the app on a device. It is hidden in
 * index.html; js/splash.js shows it once and fades it out.
 */
.app-splash {
    position: fixed;
    inset: 0;
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--app-blue);
    transition: opacity .4s ease, visibility .4s;
}

.app-splash img {
    width: min(72vw, 50vh, 360px);
    height: auto;
}

.app-splash.app-splash-hidden {
    opacity: 0;
    visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .app-splash {
        transition: none;
    }
}

/* --- Views --------------------------------------------------------------- */

.app-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    margin-bottom: 8px;
}

.app-empty {
    padding: 24px;
    text-align: center;
}
