/* ============================================================
   AULA.CSS - Mode aula per a les pantalles tàctils ORBYS (js/aula.js)
   ============================================================
   1. Sempre (escriptori i tàctil): toc ràpid i sense ressaltat blau
   2. Botó «Aula» de la capçalera
   3. Mode aula (html.aula): tot a escala de pantalla gran
   4. Barra de tecles tàctils de la terminal
   ============================================================ */

/* ------------------------------------------------------------
   1. SEMPRE: sense el retard de doble toc ni el ressaltat d'Android
   ------------------------------------------------------------ */
button, a, input, [role="tab"], .nav-item, .fsv-row {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ------------------------------------------------------------
   2. BOTÓ «AULA» (reutilitza l'estil del botó de tema)
   ------------------------------------------------------------ */
.aula-btn[aria-pressed="true"] {
  background: #fff;
  color: var(--color-accent-dark);
  font-weight: 700;
}

/* ------------------------------------------------------------
   3. MODE AULA
   La lletra base creix amb l'amplada de la pantalla: a 3840 px
   (ORBYS 4K) val uns 40 px, és a dir, com 2,2 vegades l'escriptori.
   Quasi tot l'app està en rem, així que creix tot alhora.
   ------------------------------------------------------------ */
html.aula {
  font-size: clamp(17px, 1.05vw, 44px);
  --sidebar-width: clamp(240px, 15vw, 640px);
  --header-height: clamp(64px, 4.4vw, 170px);
}
html.aula .tab-content { max-width: min(96vw, 2600px); }
html.aula #tab-terminal { max-width: none; }

/* Botons i elements tocables: mínim ~60 px de veres a la ORBYS */
html.aula button,
html.aula .nav-item,
html.aula .filter-btn {
  min-height: 2.8rem;
}
html.aula .fsv-row { min-height: 2.8rem; }
html.aula .fsv-caret { width: 2.4rem; height: 2.6rem; }
html.aula .fsv-name { padding: 0.45rem 0.6rem 0.45rem 0.35rem; }
html.aula .fsv-tool { min-height: 2.6rem; padding: 0.4rem 1rem; }
html.aula .theme-btn, html.aula .teacher-btn { min-height: 2.6rem; }
html.aula .search-input { width: 13rem; min-height: 2.6rem; }
html.aula .search-input:focus { width: 17rem; }

/* Feedback de toc: l'alumne veu que ha tocat */
html.aula button:active { transform: scale(0.95); }

/* La columna creix cap avall: l'exercici i la barra tàctil no han
   d'aixafar la terminal (si no cap, la pàgina es desplaça) */
html.aula .term-layout { height: auto; min-height: calc(100vh - var(--header-height) - 3rem); }
html.aula .term-col .terminal-wrapper { flex: none; height: max(48vh, 20rem); }
html.aula .fsv { max-height: calc(100vh - var(--header-height) - 2rem); }

/* La terminal, més llegible des del fons de l'aula */
html.aula .terminal-output { font-size: 1.05rem; line-height: 1.55; }
html.aula .terminal-input-row { padding-top: 0.6rem; padding-bottom: 0.6rem; }
html.aula .terminal-input, html.aula .terminal-prompt { font-size: 1.1rem; }

/* ------------------------------------------------------------
   4. BARRA DE TECLES TÀCTILS (només en mode aula)
   ------------------------------------------------------------ */
.term-touchbar { display: none; }
html.aula .term-touchbar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.2rem 0 0.4rem;
}
.touch-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.touch-key {
  min-height: 3rem;
  min-width: 3rem;
  padding: 0.35rem 0.9rem;
  border-radius: 0.5rem;
  border: 2px solid var(--term-border);
  border-bottom-width: 4px;
  background: var(--term-bar);
  color: var(--term-fg);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s ease, filter 0.08s ease;
}
.touch-key:active { transform: scale(0.93); filter: brightness(1.25); }
.touch-key.is-main { background: var(--color-accent); border-color: var(--color-accent-dark); color: #fff; margin-left: auto; padding: 0.35rem 1.6rem; }
.touch-key.is-bit { color: var(--term-cyan); }
.touch-key:focus-visible { outline: 3px solid var(--color-info); outline-offset: 2px; }
