/*
 * Themes and icons for the static landing pages. These pages have no Yii, no users and their own
 * document root, so they cannot load common/assets/theme.
 * The ksk, kskforeign and kckfoz folders hold identical copies of theme/: change all three.
 */

@font-face {
    font-family: "Font Awesome 6 Free";
    font-style: normal;
    font-weight: 900;
    font-display: block;
    src: url(fa-solid-900.woff2) format("woff2");
}

/* ========== Icons (all themes) ========== */

.icon-briefcase:before, .icon-calendar:before, .icon-hourglass:before, .icon-book:before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}
.icon-briefcase:before { content: "\f0b1"; }
.icon-calendar:before { content: "\f073"; }
.icon-hourglass:before { content: "\f252"; }
.icon-book:before { content: "\f518"; }

/* ========== Switcher (all themes) ========== */

.emis-theme-switch {
    position: fixed;
    z-index: 6000;
    top: 16px;
    right: 16px;
}
.emis-theme-switch button { margin: 0; box-shadow: none; font-family: inherit; font-weight: normal; cursor: pointer; }
.emis-theme-switch i:before { font-family: "Font Awesome 6 Free"; font-style: normal; font-weight: 900; }
.emis-theme-switch .i-palette:before { content: "\f53f"; }
.emis-theme-switch .i-light:before { content: "\f185"; }
.emis-theme-switch .i-dark:before { content: "\f186"; }
.emis-theme-switch .i-standard:before { content: "\f5c3"; }

.emis-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #ccc;
    border-radius: 20px;
    background: #fff;
    color: #222;
    font-size: 14px;
    line-height: 20px;
}
.emis-theme-toggle:hover, .emis-theme-toggle:focus { background: #f3f3f3; color: #222; outline: none; }

.emis-theme-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 170px;
    margin: 4px 0 0;
    padding: 6px;
    list-style: none;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.emis-theme-switch.open .emis-theme-menu { display: block; }
.emis-theme-menu li { margin: 0; padding: 0; list-style: none; }

.emis-theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #222;
    font-size: 14px;
    line-height: 20px;
    text-align: left;
}
.emis-theme-option i { width: 16px; text-align: center; color: #993333; }
.emis-theme-option:hover, .emis-theme-option:focus { background: #f3f3f3; color: #222; outline: none; }
.emis-theme-option[aria-checked="true"] { background: #f7eaea; color: #993333; font-weight: 600; }

/* ========== Light and dark ========== */

html[data-theme="light"] {
    --t-bg: #f4f5f7;
    --t-surface: #ffffff;
    --t-surface-2: #f8f9fb;
    --t-border: #e1e4e9;
    --t-text: #1f2733;
    --t-accent: #993333;
    --t-accent-hover: #7d2828;
    --t-accent-text: #993333;
    --t-accent-soft: rgba(153, 51, 51, .09);
    --t-shadow: rgba(153, 51, 51, .25);
    color-scheme: light;
}
html[data-theme="dark"] {
    --t-bg: #12151a;
    --t-surface: #1b1f27;
    --t-surface-2: #222732;
    --t-border: #323947;
    --t-text: #e5e7eb;
    --t-accent: #b34747;
    --t-accent-hover: #c65c5c;
    --t-accent-text: #f0a0a0;
    --t-accent-soft: rgba(224, 122, 122, .14);
    --t-shadow: rgba(0, 0, 0, .5);
    color-scheme: dark;
}

html[data-theme="light"], html[data-theme="dark"],
html[data-theme="light"] body, html[data-theme="dark"] body { background: var(--t-bg); color: var(--t-text); }

html[data-theme="light"] h1, html[data-theme="dark"] h1,
html[data-theme="light"] h3, html[data-theme="dark"] h3,
html[data-theme="light"] .feature h3, html[data-theme="dark"] .feature h3 { color: var(--t-text); }

html[data-theme="light"] .hi-icon, html[data-theme="dark"] .hi-icon {
    background: var(--t-accent);
    color: #fff;
    box-shadow: 0 6px 16px var(--t-shadow);
    transition: transform .2s, box-shadow .2s, background-color .2s;
}
html[data-theme="light"] .hi-icon:hover, html[data-theme="dark"] .hi-icon:hover {
    background: var(--t-accent-hover);
    color: #fff;
    transform: translateY(-3px);
}
html[data-theme="light"] .hi-icon:before, html[data-theme="dark"] .hi-icon:before,
html[data-theme="light"] .hi-icon:after, html[data-theme="dark"] .hi-icon:after { color: inherit; }

/* The logo has dark lettering on a transparent background. */
html[data-theme="dark"] .site-index .text-center h1 img {
    padding: 10px 24px !important;
    border-radius: 14px;
    background: #eef0f3;
}

html[data-theme="light"] .emis-theme-toggle, html[data-theme="dark"] .emis-theme-toggle { background: var(--t-surface); border-color: var(--t-border); color: var(--t-text); }
html[data-theme="light"] .emis-theme-toggle:hover, html[data-theme="dark"] .emis-theme-toggle:hover,
html[data-theme="light"] .emis-theme-toggle:focus, html[data-theme="dark"] .emis-theme-toggle:focus { background: var(--t-surface-2); color: var(--t-text); }
html[data-theme="light"] .emis-theme-menu, html[data-theme="dark"] .emis-theme-menu { background: var(--t-surface); border-color: var(--t-border); }
html[data-theme="light"] .emis-theme-option, html[data-theme="dark"] .emis-theme-option { color: var(--t-text); }
html[data-theme="light"] .emis-theme-option i, html[data-theme="dark"] .emis-theme-option i { color: var(--t-accent-text); }
html[data-theme="light"] .emis-theme-option:hover, html[data-theme="dark"] .emis-theme-option:hover,
html[data-theme="light"] .emis-theme-option:focus, html[data-theme="dark"] .emis-theme-option:focus { background: var(--t-surface-2); color: var(--t-text); }
html[data-theme="light"] .emis-theme-option[aria-checked="true"], html[data-theme="dark"] .emis-theme-option[aria-checked="true"] { background: var(--t-accent-soft); color: var(--t-accent-text); }

@media print {
    .emis-theme-switch { display: none; }
}
