/* Wordmorrow global stylesheet: the only application stylesheet (no component CSS, STD-STYLE).
   Every --omni-* variable used here is declared by OmniEurope.Blazor. Mobile first: the base rules target
   phones, the 40rem breakpoint widens. */

html, body {
    margin: 0;
    height: 100%;
}

#app {
    height: 100%;
}

.wm-theme-scope {
    height: 100%;
}

.wm-shell {
    height: 100%;
}

.wm-page {
    /* Full width up to the cap: auto margins in the column flex of the main area would otherwise size
       the page to its content, and a fixed-width child (the 25rem login card) would overflow a phone. */
    width: 100%;
    padding: 1rem;
    max-width: 64rem;
    margin: 0 auto;
    box-sizing: border-box;
    min-width: 0;
}

.wm-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.wm-header-end {
    margin-inline-start: auto;
}

.wm-field-error {
    display: block;
    margin-top: 0.25rem;
}

/* Boot screen shown until WebAssembly starts. */
.wm-boot {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.wm-boot__logo {
    animation: wm-float 1.6s ease-in-out infinite;
}

@keyframes wm-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-0.5rem); }
}

@media (prefers-reduced-motion: reduce) {
    .wm-boot__logo {
        animation: none;
    }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    padding: 0.75rem 1rem;
    z-index: 1000;
    background: var(--omni-color-danger);
    color: var(--omni-color-on-danger);
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    margin-inline-start: 1rem;
    color: inherit;
    cursor: pointer;
}

/* Public home */
.wm-landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    padding: 2rem 0;
}

.wm-landing__lead {
    max-width: 36rem;
    color: var(--omni-color-text-muted);
}

.wm-landing__points {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    width: 100%;
    text-align: start;
}

@media (min-width: 40rem) {
    .wm-landing__points {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.wm-legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    margin-top: 1.5rem;
    font-size: var(--omni-font-size-sm);
}

.wm-legal {
    overflow-wrap: anywhere;
}

/* Learning: cards, exercises, feedback. */
.wm-step-card {
    margin-top: 1rem;
}

.wm-card-head {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wm-word-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wm-word {
    font-size: var(--omni-font-size-h2);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.wm-translation {
    font-size: var(--omni-font-size-lg);
}

.wm-pronunciation {
    font-style: italic;
}

.wm-sentence {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-wrap: anywhere;
}

.wm-sentence--exercise {
    display: block;
    font-size: var(--omni-font-size-lg);
    line-height: 1.8;
}

.wm-gap {
    /* The sentence keeps its own spaces: no margin, or punctuation after the gap drifts away. */
    display: inline-block;
    min-width: 3rem;
    letter-spacing: 0.15em;
    color: var(--omni-color-accent);
}

.wm-target {
    color: var(--omni-color-accent);
}

.wm-keyboard {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.wm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.wm-actions--start {
    justify-content: flex-start;
}

.wm-choices {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
}

.wm-choice {
    min-height: 2.75rem;
}

.wm-exercise-head {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wm-session-progress {
    margin: 0.5rem 0;
}

.wm-stat-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.wm-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.wm-activity-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
}

.wm-result-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wm-result-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--omni-color-border);
}

.wm-result-row:last-child {
    border-bottom: none;
}

.wm-result-word {
    font-weight: 600;
}

.wm-result-translation {
    flex: 1 1 8rem;
    color: var(--omni-color-text-muted);
}

@media (min-width: 40rem) {
    .wm-choices,
    .wm-activity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wm-stat-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .wm-stat-row--4,
    .wm-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Dictionary and lists. */
.wm-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
}

/* CEFR levels of the new words: one column per band (A, B, C), the two levels of a band stacked. */
.wm-levels {
    grid-auto-flow: column;
    grid-template-columns: repeat(3, max-content);
    grid-template-rows: auto auto;
    column-gap: 2rem;
}

.wm-levels > :not(label) {
    grid-column: 1 / -1;
}

.wm-entry-row {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    box-sizing: border-box;
    min-height: 2.75rem;
    padding: 0.25rem;
    color: inherit;
    text-decoration: none;
}

.wm-entry-row:hover,
.wm-entry-row:focus-visible {
    background: var(--omni-color-surface-hover);
}

.wm-entry-row > .wm-result-translation {
    /* Shrinks and wraps before the state badge has to go to a second line. */
    flex: 1 1 0;
    min-width: 0;
}

.wm-entry-row > .omni-badge {
    /* The state sits at the end of the line, so a word takes one line on a phone. */
    margin-inline-start: auto;
}

.wm-list-entry {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wm-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
}

.wm-history-row {
    font-size: var(--omni-font-size-sm);
}

@media (min-width: 40rem) {
    .wm-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Statistics. */
.wm-badges {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
}

.wm-badge-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wm-theme-progress {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--omni-color-border);
}

@media (min-width: 40rem) {
    .wm-badges {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Back office */
.wm-badges-inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--omni-space-2, 0.5rem);
}

.wm-issue-list {
    margin: 0;
    padding-inline-start: 1.25rem;
    display: grid;
    gap: 0.25rem;
    overflow-wrap: anywhere;
}
