@import url("tokens.css");
@import url("components.css");

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, sans-serif;
    font-size: 100%;
    scroll-padding-top: 1rem;
}

html[data-ts="125"] {
    font-size: 125%;
}

html[data-ts="150"] {
    font-size: 150%;
}

html[data-ts="200"] {
    font-size: 200%;
}

body {
    min-height: 100vh;
    margin: 0;
    background-color: var(--bg);
    background-image: url("../img/fondo-iconos-claro.svg");
    background-position: center top;
    background-repeat: repeat;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.5;
}

html[data-theme="dark"] body {
    background-image: url("../img/fondo-iconos-oscuro.svg");
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button:disabled,
select:disabled {
    cursor: not-allowed;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

p {
    margin: 0;
}

a {
    color: var(--link);
}

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

:focus:not(:focus-visible) {
    outline: none;
}

#app {
    min-height: 100vh;
}

.app-surface {
    min-height: 100vh;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    z-index: 1000;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    padding: 1rem;
    border: 1px solid var(--bad);
    border-radius: 0.75rem;
    background: var(--card);
    color: var(--ink);
}

html[data-ts="150"] body :is(header, .stk, .snav),
html[data-ts="200"] body :is(header, .stk, .snav) {
    position: static;
}

/* La barra superior con texto grande: "relative" se comporta igual que "static"
   (no se queda fija al hacer scroll), pero conserva su z-index. Con "static" la foto
   del inicio de sesión se dibujaba ENCIMA del menú "Aa" y no se podía regresar a 100 %. */
html:is([data-ts="150"], [data-ts="200"]) body header.topbar {
    position: relative;
    z-index: 115;   /* arriba del botón del asistente (110) para que no tape el menú */
}

html[data-ts="150"] .staff-shell__sidebar,
html[data-ts="200"] .staff-shell__sidebar {
    position: static;
}

html[data-ts="150"] .staff-shell,
html[data-ts="200"] .staff-shell {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
}

html[data-ts="150"] .staff-shell__sidebar,
html[data-ts="200"] .staff-shell__sidebar {
    max-height: none;
}

html[data-ts="150"] .student-home,
html[data-ts="200"] .student-home {
    width: calc(100% - 2rem);
    max-width: var(--content-width);
    min-width: 0;
}

html[data-ts="150"] .alumno-comprobante > p,
html[data-ts="200"] .alumno-comprobante > p {
    width: 100%;
    min-width: 0;
}

html[data-ts="150"] .alumno-comprobante__sello,
html[data-ts="200"] .alumno-comprobante__sello {
    max-width: 100%;
    letter-spacing: normal;
}

html[data-ts="150"] .topbar,
html[data-ts="200"] .topbar {
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-inline: 1rem;
}

html[data-ts="150"] .topbar__acciones,
html[data-ts="200"] .topbar__acciones {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    min-width: 0;
}

/* Con texto grande los botones de la barra bajan a un renglón propio y quedan del lado
   IZQUIERDO. El menú "Aa" (y el del usuario) se abría hacia la izquierda del botón
   (right: 0) y se salía de la pantalla, así que ya no se podía regresar a 100 %.
   Ahora se abre hacia la DERECHA del botón y nunca es más ancho que la pantalla. */
html[data-ts="150"] .topbar__menu,
html[data-ts="200"] .topbar__menu {
    right: auto;
    left: 0;
    max-width: calc(100vw - 2rem);
}

html[data-ts="150"] .resultados-personal .tabla-resultados,
html[data-ts="200"] .resultados-personal .tabla-resultados {
    display: block;
    overflow-x: auto;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
