/* Fredoka (self-hosted; Google Fonts variable font v17), the brand face: wordmark, sign-in and Hedda's own
   lines. latin-ext carries nothing Swedish needs but keeps names like Łukasz in the face. */
@font-face {
    font-family: 'Fredoka';
    src: url('/fonts/fredoka/fredoka-latin.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
    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: 'Fredoka';
    src: url('/fonts/fredoka/fredoka-latin-ext.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
    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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Manrope (self-hosted; Google Fonts variable font v20). One file per subset, covering the full
   weight axis (used at 400/600/700). unicode-range lets the browser fetch only the subsets it needs. */
@font-face {
    font-family: 'Manrope';
    src: url('/fonts/manrope/manrope-latin.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
    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: 'Manrope';
    src: url('/fonts/manrope/manrope-latin-ext.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
    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: 'Manrope';
    src: url('/fonts/manrope/manrope-cyrillic.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Manrope';
    src: url('/fonts/manrope/manrope-cyrillic-ext.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
    font-family: 'Manrope';
    src: url('/fonts/manrope/manrope-greek.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

@font-face {
    font-family: 'Manrope';
    src: url('/fonts/manrope/manrope-vietnamese.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

body, p {
    font-family: 'Manrope', ui-sans-serif, system-ui, sans-serif;
}

/* Painted before Blazor boots too, so the night theme's loading screen is not a white flash. */
body {
    background-color: var(--color-background-main);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Manrope', ui-sans-serif, system-ui, sans-serif;
    font-weight: 600;
}

/* Headings may be focused programmatically (e.g., FocusOnNavigate). Don't show focus rings on headings. */
h1:focus-visible,
h2:focus-visible,
h3:focus-visible,
h4:focus-visible,
h5:focus-visible,
h6:focus-visible {
    outline: none !important;
}

/* Links use secondary theme colors */
a, .btn-link {
    color: var(--color-secondary-dark);
}

a:hover, .btn-link:hover {
    color: var(--color-secondary);
}

/* Primary buttons use primary theme colors */
.btn-primary {
    color: var(--color-on-primary);
    background-color: var(--color-primary);
    border-color: var(--color-primary-hover);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-dark);
}

/* Focus states use primary color */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--color-background-card), 0 0 0 0.25rem var(--color-primary);
}

:where(a, button, input, textarea, select, summary, [role="button"], [tabindex]):focus-visible {
  outline: 2px solid var(--color-primary) !important;
  outline-offset: 2px !important;
}

/* Inputs and textareas use border instead of outline for cleaner look */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none !important;
  border-color: var(--color-primary) !important;
}

.content {
    padding-top: 1.1rem;
}

/* Validation states use theme colors */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--color-success);
}

.invalid {
    outline: 1px solid var(--color-error);
}

.validation-message {
    color: var(--color-error-dark);
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNj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NTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress svg {
        width: 100%;
        height: 100%;
    }

    .loading-progress circle {
        fill: none;
        stroke: var(--color-border);
        stroke-width: 0.4rem;
        stroke-linecap: round;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--color-primary);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

    /* Hedda waits inside the ring. */
    .loading-progress img {
        position: absolute;
        left: 50%;
        top: 50%;
        width: 4.75rem;
        transform: translate(-50%, -50%);
    }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-family: 'Fredoka', ui-rounded, system-ui, sans-serif;
    font-weight: 500;
    color: var(--color-text-muted);
    inset: calc(20vh + 9rem) 0 auto 0;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.text-default-color {
    color: black;
}

/* ApexCharts theme-aware labels */
.apexcharts-xaxis-label,
.apexcharts-yaxis-label,
.apexcharts-legend-text {
    fill: var(--color-text-primary) !important;
}

.apexcharts-legend-text {
    color: var(--color-text-primary) !important;
}

.apexcharts-gridline {
    stroke: var(--color-border) !important;
}

/* Toast animations */
@keyframes slide-in-from-top {
    from {
        opacity: 0;
        transform: translateY(-1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-in {
    animation: slide-in-from-top 0.3s ease-out;
}
/* Company News rich-text editor (Quill) */
.news-editor .ql-container {
    min-height: 14rem;
    font-size: 0.95rem;
    border: none;
}

.news-editor .ql-toolbar {
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.news-editor .ql-editor {
    min-height: 14rem;
}

/* Rendered news article body */
.news-content {
    line-height: 1.7;
    word-break: break-word;
}

.news-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1.5rem 0 0.75rem;
    line-height: 1.3;
}

.news-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    line-height: 1.3;
}

.news-content p {
    margin: 0 0 1rem;
}

.news-content ul,
.news-content ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.news-content ul { list-style: disc; }
.news-content ol { list-style: decimal; }
.news-content li { margin: 0.25rem 0; }

.news-content a {
    color: var(--color-primary);
    text-decoration: underline;
}

.news-content blockquote {
    border-left: 3px solid var(--color-border);
    padding-left: 1rem;
    margin: 0 0 1rem;
    color: var(--color-text-secondary);
    font-style: italic;
}

.news-content .ql-align-center { text-align: center; }
.news-content .ql-align-right { text-align: right; }
.news-content .ql-align-justify { text-align: justify; }

/* One-shot attention flash for rows revealed via a jump link; applied from JS (revealElement). */
.reveal-pulse {
    animation: reveal-pulse 1.5s ease-out;
}

@keyframes reveal-pulse {
    0%, 25% { background-color: rgb(var(--color-primary-rgb) / 0.22); }
    100% { background-color: transparent; }
}

/* The sign-in sky (Features/SignIn/SignInScene). Ink on paper in the day theme, a night sky in the night
   theme. Continuous motion is suppressed by motion-reduce:animate-none on the elements. */
:root {
    --scene-star-rgb: 19 41 75;
    --scene-ink-rgb: 19 41 75;
    --scene-sea-rgb: 226 236 245;
    --scene-dusk-alpha: 0.16;
    --scene-field-alpha: 0.45;
}

:root[data-theme="hedda-night"] {
    --scene-star-rgb: 255 246 232;
    --scene-ink-rgb: 143 184 216;
    --scene-sea-rgb: 8 18 40;
    --scene-dusk-alpha: 0.07;
    --scene-field-alpha: 1;
}

.scene-star {
    fill: rgb(var(--scene-star-rgb));
}

/* On paper a full-strength field reads as dust; in the night sky it is the point. */
.scene-field {
    opacity: var(--scene-field-alpha);
}

.scene-twinkle {
    animation: scene-twinkle 6s ease-in-out infinite;
}

@keyframes scene-twinkle {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.25; }
}

.scene-sparkle {
    transform-box: fill-box;
    transform-origin: center;
    animation: scene-sparkle 5s ease-in-out infinite;
}

@keyframes scene-sparkle {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50%      { transform: scale(0.72); opacity: 0.55; }
}

.scene-dusk-stop {
    stop-color: rgb(var(--color-accent-rgb));
    stop-opacity: var(--scene-dusk-alpha);
}

.scene-dusk-stop-clear {
    stop-opacity: 0;
}

.scene-sea {
    fill: rgb(var(--scene-sea-rgb));
}

.scene-sea-front {
    fill: rgb(var(--scene-sea-rgb));
    stroke: rgb(var(--scene-ink-rgb) / 0.45);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.scene-wave {
    fill: none;
    stroke: rgb(var(--scene-ink-rgb));
    stroke-opacity: 0.4;
    stroke-width: 1.2;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

/* The wave paths repeat every 400 units, so moving one period loops without a seam. */
.scene-drift {
    animation: scene-drift 50s linear infinite;
}

@keyframes scene-drift {
    to { transform: translateX(-400px); }
}

/* Feedback launcher (Shell/Feedback). Suppressed by motion-reduce:animate-none on the elements. */

/* Slides the docked tab out a little and back, three times a session: noticed, never nagging. */
.feedback-peek {
    animation: feedback-peek 80s ease-in-out 6s 3;
}

@keyframes feedback-peek {
    0%, 2.4%, 100% { transform: translateX(0); }
    1%, 1.4%       { transform: translateX(-0.625rem); }
}

/* Hedda waves her flipper each time the launcher opens; the rule re-matching restarts the animation. */
.group[data-expanded="true"] .feedback-hedda .hedda-flipper {
    animation: feedback-flipper 0.9s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
    .group[data-expanded="true"] .feedback-hedda .hedda-flipper {
        animation: none;
    }
}

@keyframes feedback-flipper {
    0%, 100% { transform: rotate(0); }
    25%      { transform: rotate(-22deg); }
    50%      { transform: rotate(10deg); }
    75%      { transform: rotate(-16deg); }
}

.feedback-wiggle {
    transform-origin: 50% 100%;
    animation: feedback-wiggle 0.9s ease-in-out;
}

@keyframes feedback-wiggle {
    0%, 100% { transform: rotate(0) scale(1); }
    20%      { transform: rotate(-14deg) scale(1.15); }
    40%      { transform: rotate(12deg) scale(1.15); }
    60%      { transform: rotate(-8deg) scale(1.1); }
    80%      { transform: rotate(4deg) scale(1.05); }
}

/* Hedda (Hedda.Components/Brand/Hedda). Continuous motion is suppressed by motion-reduce:animate-none on the elements. */
.hedda {
    overflow: visible;
}

.hedda-line {
    stroke: #13294B;
    stroke-width: 3;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* Her navy outline vanishes into the night theme's navy surfaces; a light edge keeps her whole. */
:root[data-theme="hedda-night"] .hedda {
    filter: drop-shadow(0 0 1px #FFF6E8) drop-shadow(0 0 1px #FFF6E8);
}

.hedda-eye {
    transform-box: fill-box;
    transform-origin: center;
}

/* A single blink, then later a double one, so the rhythm never reads as a metronome. */
.hedda-blink {
    animation: hedda-blink 7s infinite;
}

@keyframes hedda-blink {
    0%, 40%, 44%, 88%, 91%, 94%, 100% { transform: scaleY(1); }
    42%, 89.5%, 92.5%                 { transform: scaleY(0.1); }
}

/* Set from js/hedda.js while a pointer is near. */
.hedda-pupil {
    transform: translate(var(--hedda-look-x, 0px), var(--hedda-look-y, 0px));
    transition: transform 150ms ease-out;
}

.hedda-wave {
    transform-origin: 34px 118px;
    animation: hedda-wave 2.4s ease-in-out infinite;
}

@keyframes hedda-wave {
    0%, 60%, 100% { transform: rotate(0); }
    70%           { transform: rotate(-14deg); }
    80%           { transform: rotate(8deg); }
    90%           { transform: rotate(-8deg); }
}

.hedda-flipper {
    transform-box: fill-box;
    transform-origin: 30% 100%;
}

/* An avatar crop shows the circle the picture will be shown in; the stored image stays square. */
.image-crop-round .cropper-view-box,
.image-crop-round .cropper-face {
    border-radius: 50%;
}
