/*
 * theme-base.css
 *
 * Static CSS shared by the Kotlin host FTL templates:
 *   APP_HTML.ftl, DOWNLOAD_HTML.ftl, PROFILE_HTML.ftl,
 *   PSS2_HTML.ftl
 *
 * Only the truly dynamic, per-request bits remain inline in the FTL
 * templates (per-portal background image URLs and DOWNLOAD's page-specific
 * background colour).
 *
 * Per-theme overrides live in theme-<themeRef>.css.
 */

/* ===== Fonts ===== */
@font-face {
    font-family: 'NotoEmoji';
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    src: url('/fonts/NotoEmoji-Regular.ttf') format('ttf');
}

@font-face {
    font-family: 'NotoSans';
    font-style: normal;
    font-weight: normal;
    font-size: 14px;
    src: url('/fonts/NotoSansDisplay-470.woff2') format('woff2');
}

@font-face {
    font-family: 'NotoSans';
    font-style: normal;
    font-weight: bold;
    font-size: 14px;
    src: url('/fonts/NotoSansDisplay-700.woff2') format('woff2');
}

@font-face {
    font-family: 'NotoSans';
    font-style: italic;
    font-weight: normal;
    font-size: 14px;
    src: url('/fonts/NotoSansDisplay-Italic-470.woff2') format('woff2');
}

@font-face {
    font-family: 'NotoSans';
    font-style: italic;
    font-weight: bold;
    font-size: 14px;
    src: url('/fonts/NotoSansDisplay-Italic-700.woff2') format('woff2');
}

/* ===== html / body base ===== */
html {
    height: 100%;
    scroll-behavior: smooth;
    --lemniscus-bg-color: transparent;
    --lemniscus-footer-seal-bg-color: transparent;
    background-color: var(--lemniscus-bg-color) !important;
}
/* Background-image-related rules (cover/position/repeat/attachment) live in
   the per-page inline <style>, gated by <#if backgroundHD??>, because they
   only make sense when a portal background image is actually set. */

body {
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    height: 100%;
    box-sizing: border-box;
    background-color: transparent !important;
}

:root {
    --bs-body-font-family: 'NotoSans', 'NotoEmoji', 'Helvetica', sans-serif !important;
}

/* ===== APP_HTML host ===== */
#app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    font-family: var(--bs-body-font-family);
}

#app-wrapper > #app,
#app-wrapper > #pss {
    flex: 1 0 auto;
    box-sizing: border-box;
}

#app-footer-bar {
    flex-shrink: 0;
    background-color: var(--lemniscus-bg-color);
}

#app-main, #app-floating > *, #loading {
    margin: 0;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    min-width: 330px;
    border: 1px solid var(--bs-border-color);
    overflow: hidden;
}

#loading {
    padding: 20px 12px;
    font-size: 130%;
    text-transform: uppercase;
    line-height: normal;
}

#loading > *:first-child {
    margin-bottom: 10px;
    font-size: 14px;
    color: #555a5a;
}

#app-main, #loading {
    background-color: white;
    max-width: 550px;
}

#app-floating > * {
    margin-bottom: 0;
}

#app-floating {
    background-color: white;
    width: calc(100% - 600px);
    max-width: 720px;
    float: right;
    box-sizing: border-box;
}

/* ===== PSS host (PSS2_HTML, PROFILE_HTML) ===== */
#pss:not(.pss-full-width) {
    --pss-font-family: 'NotoSans', 'NotoEmoji', 'Helvetica', sans-serif;
    font-family: var(--pss-font-family);
    min-width: 400px;
}

#pss.pss-full-width {
    --pss-font-family: 'NotoSans', 'NotoEmoji', 'Helvetica', sans-serif;
    font-family: var(--pss-font-family);
    width: 100%;
}

#pss:not(.pss-full-width) #pss-main,
#pss:not(.pss-full-width) #pss-video,
#pss:not(.pss-full-width) #pss-teaser,
#pss:not(.pss-full-width) #pss-loading {
    margin: 0;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    min-width: 330px;
    border: 1px solid var(--bs-border-color);
    overflow: hidden;
}

#pss.pss-full-width #pss-main,
#pss.pss-full-width #pss-video,
#pss.pss-full-width #pss-teaser,
#pss.pss-full-width #pss-loading {
    margin: 0;
    min-width: 330px;
}

#pss.pss-full-width #pss-loading {
    border: none;
    overflow: visible;
}

#pss-loading > div > *:first-child {
    margin-bottom: 10px;
    font-size: 14px;
    color: #555a5a;
}

#pss-main, #pss:not(.pss-full-width) #pss-loading {
    max-width: 550px;
}

#pss-video, #pss-teaser {
    margin-bottom: 0;
}

#pss-floating {
    width: calc(100% - 600px);
    max-width: 720px;
    float: right;
    box-sizing: border-box;
}

.peStarsStyle {
    font-family: sans-serif;
    background-color: #fff;
    color: #fff;
    padding: 0 10px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    box-sizing: border-box;
    border-top-left-radius: 8px;
    border-left: 1px solid #cdcdcd;
    border-top: 1px solid #cdcdcd;
}

.peStarsStyle a,
.peStarsStyle a:link,
.peStarsStyle a:visited {
    color: #fff;
}

#pss .headline {
    line-height: normal;
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 0;
    font-weight: 500;
}

#pss .appName {
    font-size: 14px;
    color: #555a5a;
    text-transform: uppercase;
}

#pss .container {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 0;
    width: 100%;
    padding-right: calc(var(--bs-gutter-x) * .5);
    padding-left: calc(var(--bs-gutter-x) * .5);
    margin-right: auto;
    margin-left: auto;
    box-sizing: border-box;
}

#pss .message {
    padding-top: 30px;
    padding-bottom: 30px;
    padding-left: 50px;
    padding-right: 50px;
    margin-top: 10px;
    margin-bottom: 10px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-radius: 8px;
    -webkit-border-radius: 8px;
    border: 1px solid var(--bs-border-color);
}

/* ===== Lemniscus footer seal ===== */
#lemniscus-seal {
    padding: 48px 12px 24px;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
}
#lemniscus-seal,
#lemniscus-seal .lemniscus-seal-claim,
#lemniscus-seal .footer-links a {
    color: var(--lemniscus-footer-seal-bg-color);
}

#lemniscus-seal .lemniscus-seal-brand {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}

#lemniscus-seal .lemniscus-seal-logo {
    width: 75px;
    height: auto;
}

#lemniscus-seal .lemniscus-seal-claim {
    font-size: 14px;
    line-height: 1.2;
}

#lemniscus-seal .footer-links {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 18px;
    font-size: 12px;
    line-height: 14px;
    text-transform: uppercase;
}

#lemniscus-seal .footer-links a {
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

#lemniscus-seal .footer-links a:hover {
    text-decoration: underline;
}

/* ===== Public directory accessibility ===== */
.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    padding: .75rem 1rem;
    border-radius: .375rem;
    background: #fff;
    color: #0a58ca;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .25);
}

.directory-card {
    position: relative;
    cursor: pointer;
}

.directory-card:focus-within,
.location-search-group:focus-within {
    outline: 3px solid #0a58ca;
    outline-offset: 3px;
}

.directory-card .stretched-link:focus-visible,
.skip-link:focus-visible,
.footer-links a:focus-visible,
.lemniscus-seal-brand:focus-visible {
    outline: 3px solid #0a58ca;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}


/* ===== Responsive ===== */
@media (max-width: 549px) {
    /* PSS host */
    #pss-wrapper {
        min-height: 100vh;
    }

    #pss-wrapper, #pss-main {
        display: flex;
        flex-direction: column;
    }

    #pss-main, #pss-content {
        flex-grow: 1;
    }

    .peStarsStyle {
        padding: 0 12px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
    }

    /* APP host */
    #app, #app-sections {
        min-height: 100vh;
    }

    #app, #app-sections, #app-main {
        display: flex;
        flex-direction: column;
    }

    #app-sections, #app-main, #app-content {
        flex-grow: 1;
    }
}

@media (max-width: 1100px) {
    #pss-floating {
        min-width: 330px;
        max-width: 550px;
        width: auto;
        float: none;
    }

    #app-floating {
        min-width: 330px;
        max-width: 550px;
        width: auto;
        float: none;
    }
}

@media (min-width: 550px) {
    /* PSS host */
    #pss:not(.pss-full-width) {
        padding: 30px 30px 60px;
        min-width: 460px;
    }

    #pss.pss-full-width {
        padding: 0;
    }

    #pss:not(.pss-full-width) #pss-main, 
    #pss:not(.pss-full-width) #pss-video, 
    #pss:not(.pss-full-width) #pss-teaser, 
    #pss:not(.pss-full-width) #pss-loading {
        border-radius: 8px;
    }

    #pss-video, #pss-teaser {
        margin-bottom: 20px;
    }

    /* APP host */
    #app {
        padding: 30px 30px 0;
    }

    #app-main, #app-floating > *, #loading {
        border-radius: 8px;
    }

    #app-floating > * {
        margin-bottom: 20px;
    }

    /* APP_HTML host page padding (matches GWT app shell layout) */
    body {
        padding-bottom: 0px;
    }
}
